3

I have an Electron project set up with React. I am attempting to follow the exact same code here:

https://hackernoon.com/using-a-react-16-portal-to-do-something-cool-2a2d627b0202

It works perfectly fine in Google Chrome. However, in Electron, clicking in the new Window button returns an error:

TypeError: Cannot read property 'body' of undefined

this.externalWindow.document.body.appendChild(this.containerEl);

I'm assuming that Electron and Chromium handles the new window in a different way than Chrome - I attempted to search for a solution but couldn't find one specific for Chromium or Electron. I've ran through the debugger within Electron. It appears that in this.externalWindow, document is an undefined property. This problem doesn't show up in Chrome

Any help on what I could be missing?

erli
  • 358
  • 4
  • 16
  • maybe this can help: https://stackoverflow.com/questions/42735295/minimal-example-opening-a-window-in-electron-from-react-application ? – whiteadi Sep 04 '19 at 08:19

0 Answers0