Modal Popup using React in electron


#1

Hi,
I am trying to build an Electron application which is required to have a lot of Modal Popup windows. I am using react.js to build the User Interface. What would be a safest ans easiest way of doing it ? I was unable to find any kind of tutorial on this. Should I use Modals from React or brwoserWindow options from electron ? Any kind of help on this is appreciated.


#2

It really depends what you’re using them for. Modals would probably be the easiest way of doing it, because new BrowserWindows won’t share the same context as the parent window.


#3

If you use different browser windows you are going to need to use IPC to communicate between your windows and probably block user interaction on the other windows.

IMO the best way is to tackle this with React directly on your main window unless you find some benefit in using multiple windows.