React Portal Frame
Rendering components inside iframes using react portal.
Basic Usage
const MyComponent = { return <PortalFrame> <MyOtherComponent1 /> <MyOtherComponent2 /> <MyOtherComponent3 /> </PortalFrame>}
Capturing Events
One unique feature of this component is that it fully supports react synthetic event bubbling & capturing. It means that you can capture events inside iframe from parent containers.
Component { console } { return <div onClick=thishandleClick> <PortalFrame> <h3>iFrame Content</h3> <div> <p>lorem ipsum dolor sit amet...</p> <button>Click Here</button> </div> </PortalFrame> </div> }
Styled Component Support
React Portal Frame is fully aware of styled-components, so your components render within iframe can be beautifully styled and this is done automatically so you don't have to do anything.
const MyPrettyComponent = styleddiv` color: red;` Component { return <div> <PortalFrame> <MyPrettyComponent>Lorem Ipsum Dolor Sit Amet</MyPrettyComponent> </PortalFrame> </div> }