react-portal-frame icon indicating copy to clipboard operation
react-portal-frame copied to clipboard

Question about the event handlers

Open crimx opened this issue 7 years ago • 2 comments

Nice work! :tada: While reading the source there is one place I don't quite understand. Why set all the event handlers to noop?

crimx avatar Apr 23 '18 18:04 crimx

So React doesn't capture events from components that is ported to a different view (an iframe in this case), this is a work around this limitation. It tells React to pass all events captured within iframe view to its parent's view.

iphong avatar Apr 27 '18 18:04 iphong

That's genius. How did you figure that out! :smile: I went back to dig up the source a little bit and still had no idea. Thanks for the work. This is really useful when dealing with iframe.

crimx avatar Apr 27 '18 19:04 crimx