onLoad properties on Component
Opened this issue · 3 comments
mquadrant commented
In the native iframe we have something like this:
<iframe src="/test.html" onLoad="alert(this.contentWindow.location);"></iframe> We may want to include that to the module.Ryudo302 commented
I think it's a bug, because the onLoad
attr is defined here (line 17):
https://github.com/svenanders/react-iframe/blob/master/src/types.d.ts
And here (line 42):
https://github.com/svenanders/react-iframe/blob/master/src/iframe.tsx
But it's really not working :(
FelixEhuan commented
The problem is that onLoad is defined as a void function
onLoad?: () => void,
So onLoad function doesn't returns the instance of the iframe (this
) and returns a synthetic event
instead, so you cannot acces to contentWindow
iamshouvikmitra commented
how do we access the location?