Render your React app to an iFrame
MIT License
Bot releases are hidden (Show)
Full Changelog: https://github.com/ryanseddon/react-frame-component/compare/v5.2.6...v5.2.7
Published by ryanseddon almost 2 years ago
https://github.com/ryanseddon/react-frame-component/compare/v5.2.5...v5.2.6
Published by ryanseddon almost 2 years ago
This release uses DOMContentLoaded
as a better strategy over onload
when more complex intitialContent payloads are provided.
This also accounts for timing issues and uses setInterval
to account for cold cache timing issues on resource intensive frames.
https://github.com/ryanseddon/react-frame-component/compare/v5.2.4...v5.2.5
Published by ryanseddon almost 2 years ago
https://github.com/ryanseddon/react-frame-component/compare/v5.2.3...v5.2.4
Building on v5.2.2-alpha.1 if DOMContentLoaded never fires we fallback with a setInterval
https://github.com/ryanseddon/react-frame-component/compare/v5.2.2-alpha.1...v5.2.3-alpha.0
https://github.com/ryanseddon/react-frame-component/compare/v5.2.2...v5.2.3
Published by ryanseddon over 2 years ago
This adds types directly to the package. You'll no longer need to rely on @types/react-frame-component
https://github.com/ryanseddon/react-frame-component/compare/v5.2.1...v5.2.2
Published by ryanseddon over 2 years ago
Building on v5.2.2-alpha.0 to try removing forceUpdate
, guarding against a double state update and re-introducing the onLoad
attribute.
https://github.com/ryanseddon/react-frame-component/compare/v5.2.2-alpha.0...v5.2.2-alpha.1
Published by ryanseddon almost 3 years ago
This is a pre-release testing whether using DOMContentLoaded is a better strategy over onload when more complex intitialContent
payloads are provided.
https://github.com/ryanseddon/react-frame-component/compare/v5.2.1...v5.2.2-alpha.0
https://github.com/ryanseddon/react-frame-component/compare/v5.2.0...v5.2.1
Allow to pass ref
prop to Frame component which will allow to reach the inner iframe HTMLIFrameElement
.
The ref
forwarding is done by React.forwardRef
helper which wraps the original Frame class component instance.
Example usage:
function Foo() {
const iframeRef = React.useRef()
React.useEffect(() => {
iframeRef.style.setProperty('background-color', 'pink');
}, [])
<Frame ref={iframeRef} />
}
https://github.com/ryanseddon/react-frame-component/compare/v5.1.0...v5.2.0
Published by ryanseddon over 3 years ago
Adds new useFrame
hook for access to iframes window
and document
host objects without the need for the context render prop pattern.
import { useFrame } from 'react-frame-component';
function Foo (props) {
const { window, document } = useFrame();
/* rest of the component */
}
https://github.com/ryanseddon/react-frame-component/compare/v5.0.1...v5.1.0
Published by ryanseddon over 3 years ago
Adds index.ts file to declare module for Typescript
https://github.com/ryanseddon/react-frame-component/compare/v5.0.0...v5.0.1
Published by ryanseddon over 3 years ago
This library now uses srcDoc
which means no support for IE11 in v5 if you need IE11 support you can continue to use v4.1.3.
srcDoc is also async vs doc.write being sync, this will mostly go unnoticed in most use cases. However if you're relying on this library in unit tests you may need to convert those test to async aware tests. This means you'll need to use the done
callback in most unit test frameworks.
document.write is now bad practice for performance reasons and will be flagged accordingly in various web perf testing tools, srcDoc is a viable alternative without the perf downsides.
https://github.com/ryanseddon/react-frame-component/compare/v4.1.3...v5.0.0
Published by ryanseddon almost 4 years ago
This pre-release is testing whether srcdoc
usage over doc.write()
is a better move going forward. It's a breaking change as srcdoc
is async.
By changing to srcdoc
this will drop support for IE11.