An iframe component that automatically syncs styles from the host.
An implementation of react-frame-component.
npm i @measured/auto-frame-component
import AutoFrame from "@measured/auto-frame-component";
export function Page() {
return (
<AutoFrame>
{/* Hero class exists on parent */}
<div className="Hero">Hello, world</div>
</AutoFrame>
);
}
Shares an API with react-frame-component, and exposes some additional props.
debug: boolean
Print debug messages when mounting styles to the console
onStylesLoaded: function
A callback that triggers when the initial styles are loaded
MIT © Measured Corporation Ltd