Comments (3)
@fifyrio as it's implemented now, this library won't support it, but if you simply copy the contents of https://github.com/svenanders/react-iframe/blob/master/index.js to your project, you can add support for onLoad. That's what I did, here's the code.
const Iframe = class extends PureComponent {
render() {
const props = {
ref: 'iframe',
frameBorder: '0',
src: this.props.url,
target: '_parent',
allowFullScreen: this.props.allowFullScreen || false,
style: Object.assign(
{
position: this.props.position || 'absolute',
display: this.props.display || 'block',
height: this.props.height || '100%',
width: this.props.width || '100%',
},
this.props.styles || {},
),
height: this.props.height || '100%',
name: this.props.name || '',
width: this.props.width || '100%',
onLoad: this.props.onLoad ? this.props.onLoad : undefined,
}
const { id, className } = this.props
return React.createElement(
'iframe',
Object.assign(props, id ? id : null, className ? className : null),
)
}
}
from react-iframe.
Thanks
from react-iframe.
With the merge and release of PR #24 this is now supported.
from react-iframe.
Related Issues (20)
- Get iframe current playing time HOT 1
- Its element type 'ReactElement<any, any> | Component<IIframe, any, any> | null' is not a valid JSX element. HOT 2
- Hide Iframe URL in the browser HTML HOT 1
- Bug: prop name is `allowFullScreen` HOT 2
- It's Clipboard read & write allowed? HOT 1
- Uncaught DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
- Check if user scroll till the end
- Hide scrollbars but be able to scroll
- Access duration of a video
- correct README.md array with square brackets for sandbox multiple values
- How to listen to URL changes inside the iframe and prevent URL from redirecting! HOT 3
- Bug: Camelcase 'allowFullScreen' doesn't work when 'allow' attribute is set
- Issue serving built CRA app with <Iframe src="./public/myfile.html">
- Sandbox type does not allow multiple values HOT 2
- Render HTML file from src HOT 1
- onLoad function Safari support HOT 2
- PDF in iframe on iPad - only first page is displayed HOT 1
- Expo support ? HOT 1
- allowFullScreen doesn't work for Chrome HOT 1
- how to resolve the cross domain because of iframe? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-iframe.