react-use-iframe
v1.0.0
Published
react iFrame hook
Downloads
5
Readme
react-use-iframe
iframe hook
Install
npm install --save react-use-iframe
Usage
import React from 'react'
import useIFrame from 'react-use-iframe'
const App = () => {
const { IFrame, getIFrame } = useIFrame()
console.log({
iFrameWindow: getIFrame.window,
iFrameDocument: getIFrame.document
})
return (
<IFrame
headElements={[
{
type: 'inlineStyle',
values: {
text: 'body { background: #fed136 }'
}
}
]}
title='Test'
>
<p>iFrame</p>
</IFrame>
)
}
License
MIT © marcoSven