-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to get onload event? #19
Comments
@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),
)
}
} |
Thanks |
With the merge and release of PR #24 this is now supported. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, buddy, how to get onload event?
The text was updated successfully, but these errors were encountered: