{"id":13602489,"url":"https://github.com/ryanseddon/react-frame-component","last_synced_at":"2026-04-01T22:52:22.696Z","repository":{"id":16963286,"uuid":"19725743","full_name":"ryanseddon/react-frame-component","owner":"ryanseddon","description":"Render your React app to an iFrame","archived":false,"fork":false,"pushed_at":"2026-03-29T02:04:02.000Z","size":2978,"stargazers_count":1814,"open_issues_count":16,"forks_count":157,"subscribers_count":20,"default_branch":"master","last_synced_at":"2026-03-31T18:37:06.131Z","etag":null,"topics":["component","iframe","javascript","react"],"latest_commit_sha":null,"homepage":"http://ryanseddon.github.io/react-frame-component/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanseddon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"ryanseddon"}},"created_at":"2014-05-13T04:25:39.000Z","updated_at":"2026-03-31T15:36:50.000Z","dependencies_parsed_at":"2025-03-04T21:00:43.255Z","dependency_job_id":"a588aa26-5f17-44f9-be57-506c39c389d6","html_url":"https://github.com/ryanseddon/react-frame-component","commit_stats":{"total_commits":211,"total_committers":46,"mean_commits":4.586956521739131,"dds":0.6113744075829384,"last_synced_commit":"ec8cd746878756d8646dc76a5660e79bb3d6d452"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/ryanseddon/react-frame-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanseddon%2Freact-frame-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanseddon%2Freact-frame-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanseddon%2Freact-frame-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanseddon%2Freact-frame-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanseddon","download_url":"https://codeload.github.com/ryanseddon/react-frame-component/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanseddon%2Freact-frame-component/sbom","scorecard":{"id":792415,"data":{"date":"2025-08-11","repo":{"name":"github.com/ryanseddon/react-frame-component","commit":"ff285a1f06e2905780141a82dbe2e500df9b615c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":5,"reason":"Found 10/20 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:6: update your workflow using https://app.stepsecurity.io/secureworkflow/ryanseddon/react-frame-component/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/ryanseddon/react-frame-component/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/ryanseddon/react-frame-component/ci.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:11","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"119 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-rvg8-pwq2-xj7q","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3fw8-66wf-pr7m","Warn: Project is vulnerable to: GHSA-6w62-83g6-rfhj","Warn: Project is vulnerable to: GHSA-rch9-xh7r-mqgw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-92vm-wfm5-mxvv","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-q9mw-68c2-j6m5","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-gpvr-g6gh-9mc2","Warn: Project is vulnerable to: GHSA-cm5g-3pgc-8rg4","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9qj9-36jm-prpv","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-8mmm-9v2q-x3f9","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m","Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-28xh-wpgr-7fm8","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-f9cm-p3w6-xvr3","Warn: Project is vulnerable to: GHSA-jjv7-qpx3-h62q","Warn: Project is vulnerable to: GHSA-gqgv-6jq5-jjj9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-hxcm-v35h-mg2x","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-xwg4-93c6-3h42","Warn: Project is vulnerable to: GHSA-jgqf-hwc5-hh37","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-pv4c-p2j5-38j4","Warn: Project is vulnerable to: GHSA-46c4-8wrp-j99v","Warn: Project is vulnerable to: GHSA-9m6j-fcg5-2442","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-cf66-xwfp-gvc4","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6","Warn: Project is vulnerable to: GHSA-wxhq-pm8v-cw75","Warn: Project is vulnerable to: GHSA-g74r-ffvr-5q9f","Warn: Project is vulnerable to: GHSA-mpcf-4gmh-23w8","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-ff6r-5jwm-8292","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T07:56:25.563Z","repository_id":16963286,"created_at":"2025-08-23T07:56:25.563Z","updated_at":"2025-08-23T07:56:25.563Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","iframe","javascript","react"],"created_at":"2024-08-01T18:01:25.167Z","updated_at":"2026-04-01T22:52:22.688Z","avatar_url":"https://github.com/ryanseddon.png","language":"JavaScript","readme":"# React \u0026lt;Frame /\u003e component\n\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]\n\nThis component allows you to encapsulate your entire React application or per component in an iFrame.\n\n```bash\nnpm install --save react-frame-component\n```\n\n## How to use:\n\n```js\nimport Frame from 'react-frame-component';\n```\n\nGo check out the [demo][demo-url].\n\n```html\nconst Header = ({ children }) =\u003e (\n  \u003cFrame\u003e\n    \u003ch1\u003e{children}\u003c/h1\u003e\n  \u003c/Frame\u003e\n);\n\nReactDOM.render(\u003cHeader\u003eHello\u003c/Header\u003e, document.body);\n```\n\nOr you can wrap it at the `render` call.\n\n```html\nReactDOM.render(\n  \u003cFrame\u003e\n    \u003cHeader\u003eHello\u003c/Header\u003e\n  \u003c/Frame\u003e,\n  document.body\n);\n```\n\n##### Props:\n\n###### head\n`head:  PropTypes.node`\n\nThe `head` prop is a dom node that gets inserted before the children of the frame. Note that this is injected into the body of frame (see the blog post for why). This has the benefit of being able to update and works for stylesheets.\n\n###### initialContent\n`initialContent:  PropTypes.string`\n\nDefaults to `'\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003e\u003cdiv\u003e\u003c/div\u003e\u003c/body\u003e\u003c/html\u003e'`\n\nThe `initialContent` props is the initial html injected into frame. It is only injected once, but allows you to insert any html into the frame (e.g. a head tag, script tags, etc). Note that it does *not* update if you change the prop. Also at least one div is required in the body of the html, which we use to render the react dom into.\n\n###### mountTarget\n`mountTarget:  PropTypes.string`\n\nThe `mountTarget` props is a css selector (#target/.target) that specifies where in the `initialContent` of the iframe, children will be mounted.\n\n```html\n\u003cFrame\n  initialContent='\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003e\u003ch1\u003ei wont be changed\u003c/h1\u003e\u003cdiv id=\"mountHere\"\u003e\u003c/div\u003e\u003c/body\u003e\u003c/html\u003e'\n  mountTarget='#mountHere'\n  \u003e\n\u003c/Frame\u003e\n```\n\n###### dangerouslyUseDocWrite\n`dangerouslyUseDocWrite: PropTypes.bool`\n\nDefaults to `false`\n\nThe frame's initial content, as defined by the `initialContent` prop, is populated via the frame's `srcdoc` attribute by default. However, this can cause issues with some libraries such as Recaptcha and Google Maps that depend on the frame's location/origin. In these cases, setting this flag will cause `Frame` to use `document.write()` to populate the initial content. This is **unperformant and unrecommended**, but allows these libraries to be used inside a `Frame` instance.\n\n###### contentDidMount and contentDidUpdate\n`contentDidMount:  PropTypes.func`\n`contentDidUpdate:  PropTypes.func`\n\n`contentDidMount` and `contentDidUpdate` are conceptually equivalent to\n`componentDidMount` and `componentDidUpdate`, respectively. The reason these are\nneeded is because internally we call `ReactDOM.render` which starts a new set of\nlifecycle calls. This set of lifecycle calls are sometimes triggered after the\nlifecycle of the parent component, so these callbacks provide a hook to know\nwhen the frame contents are mounted and updated.\n\n###### ref\n`ref: PropTypes.oneOfType([ PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) }) ])`\n\nThe `ref` prop provides a way to access inner iframe DOM node. To utilitize this prop use, for example, one of the React's built-in methods to create a ref: [`React.createRef()`](https://reactjs.org/docs/refs-and-the-dom.html#creating-refs) or [`React.useRef()`](https://reactjs.org/docs/hooks-reference.html#useref).\n\n```js\nconst MyComponent = (props) =\u003e {\n  const iframeRef = React.useRef();\n\n  React.useEffect(() =\u003e {\n    // Use iframeRef for:\n    // - focus managing\n    // - triggering imperative animations\n    // - integrating with third-party DOM libraries\n    iframeRef.current.focus()\n  }, [])\n\n  return (\n    \u003cFrame ref={iframeRef}\u003e\n      \u003cInnerComponent /\u003e\n    \u003c/Frame\u003e\n  );\n}\n```\n\n##### Accessing the iframe's window and document\nThe iframe's `window` and `document` may be accessed via the `FrameContextConsumer` or the `useFrame` hook.\n\nThe example with `FrameContextConsumer`:\n\n```js\nimport Frame, { FrameContextConsumer } from 'react-frame-component'\n\nconst MyComponent = (props, context) =\u003e (\n  \u003cFrame\u003e\n    \u003cFrameContextConsumer\u003e\n      {\n        // Callback is invoked with iframe's window and document instances\n        ({document, window}) =\u003e {\n          // Render Children\n        }\n      }\n    \u003c/FrameContextConsumer\u003e\n  \u003c/Frame\u003e\n);\n\n```\n\nThe example with `useFrame` hook:\n\n```js\nimport Frame, { useFrame } from 'react-frame-component';\n\nconst InnerComponent = () =\u003e {\n  // Hook returns iframe's window and document instances from Frame context\n  const { document, window } = useFrame();\n\n  return null;\n};\n\nconst OuterComponent = () =\u003e (\n  \u003cFrame\u003e\n    \u003cInnerComponent /\u003e\n  \u003c/Frame\u003e\n);\n```\n\n## More info\n\nI wrote a [blog post][blog-url] about building this component.\n\n## License\n\nCopyright 2014, Ryan Seddon.\nThis content is released under the MIT license http://ryanseddon.mit-license.org\n\n[npm-url]: https://npmjs.org/package/react-frame-component\n[npm-image]: https://badge.fury.io/js/react-frame-component.png\n\n[travis-url]: http://travis-ci.org/ryanseddon/react-frame-component\n[travis-image]: https://secure.travis-ci.org/ryanseddon/react-frame-component.png?branch=master\n\n[depstat-url]: https://david-dm.org/ryanseddon/react-frame-component\n[depstat-image]: https://david-dm.org/ryanseddon/react-frame-component.png\n\n[demo-url]: http://ryanseddon.github.io/react-frame-component/\n[blog-url]: https://medium.com/@ryanseddon/rendering-to-iframes-in-react-d1cb92274f86\n","funding_links":["https://github.com/sponsors/ryanseddon"],"categories":["Awesome React","JavaScript"],"sub_categories":["Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanseddon%2Freact-frame-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanseddon%2Freact-frame-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanseddon%2Freact-frame-component/lists"}