BitMEX
BitMEX
Jan 23, 2018 · 1 min read

I’ve figured this out: render null until you mount, then on componentDidMount, create the target div, inject it in the new window, then setState({mounted: true}). Then in render(), render to the portal when mounted. This appears to set up the event proxies correctly. I was having serious trouble with key events (but oddly, not click events) until I refactored this way.

I’ll push a PR to https://github.com/rmariuzzo/react-new-window/ to illustrate.

    BitMEX

    Written by

    BitMEX

    Based in Seychelles, offers next generation crypto-coin trading platform, which supports highly leveraged trading via perpetual and fixed-date contracts.