React bubble up to the Frame component (iframe) each load event that happen in elements rendered inside it, even if browsers normally would stop this at iframe border. This is why on each such load (for example image load) Frame->handleLoad is called and the unconditional setState there would re-render the Frame.
For now I'm using a workaround like this:
<Frame>
<div onLoad={ev => ev.stopPropagation()}>{children}</div>
</Frame>
But it would be nice to have a fix in the library. For example at least:
handleLoad = () => {
if (!this.state.iframeLoaded) {
this.setState({ iframeLoaded: true });
}
};
or, maybe checking that the event target is really the iframe.
React bubble up to the Frame component (iframe) each load event that happen in elements rendered inside it, even if browsers normally would stop this at iframe border. This is why on each such load (for example image load) Frame->handleLoad is called and the unconditional setState there would re-render the Frame.
For now I'm using a workaround like this:
But it would be nice to have a fix in the library. For example at least:
or, maybe checking that the event target is really the iframe.