I am working on an Electron application which uses React.JS for building user interfaces. Now, I have to make a preference window which is different from the main window. But, I am not sure how to tackle this because of multiple entry points' dilemma. I read that using modals could be an alternative but I wanted to do this the usual way by making different windows and communicating between them through ipc.
Any advice on the matter is appreciated!

you can do this with routes
When you open a new window, load a page like this instead of using the main app.html file.
prefsWindow.loadURL(`file://${__dirname}/app.html#/prefs`);
And then in the routes file:
you can find more information here : https://github.com/chentsulin/electron-react-boilerplate/issues/623
and example code on how routes work with react here: https://reacttraining.com/react-router/web/example/route-config
GLHF;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With