ryanseddon / react-frame-component

Render your React app to an iFrame
http://ryanseddon.github.io/react-frame-component/
MIT License
1.75k stars 156 forks source link

call onLoad given as Props #220

Open yukukotani opened 2 years ago

yukukotani commented 2 years ago

Currently onLoad is overridden by handleLoad so does not works.

ryanseddon commented 2 years ago

We might need to rejig this once #207 merges as the logic moves away from onLoad to utilising DOMContentLoaded instead

yukukotani commented 2 years ago

@ryanseddon oh I didn't notice that.

Or maybe we don't need this. We manually subscribe load event by addEventListener so it seems there is no reason to give onLoad props of iframe. Can we just remove onLoad props at line 139?

yukukotani commented 2 years ago

@ryanseddon Sorry please forget the comment above, i misunderstood the logic.

I've added the commit 85b924e so that this PR won't conflict with #207.