electron-webpack
electron-webpack copied to clipboard
multiple renderer windows
Hi,
My app have multiple renderer windows with different html/js files. All inside the renderer folder. How can i add multiple entries for them?
You need a router. Basically each window will load the same html file, but you'll put a ?route=*** query parameter or something to instruct the renderer on which page/component it should actually load.
I've published this very simple router for solving the problem: https://www.npmjs.com/package/react-router-static, just add a ?route=*** parameter to the url and you're set.
@fabiospampinato my project does not use React, how to achieve the same without it?
@febox6 the question is so general that I'd answer it with: learn to program.
Ok, thanks anyway, from your answer I got that the router solution is not react exclusive.
@febox6 yeah "routing" just means taking a different path depending on whatever. No matter the UI framework you're using you can always do this:
- From the main process tell the renderer process which route/path to take, in my example above I'm doing that my setting a url parameter called "route".
- Then from the renderer process you read that parameter and do something different (in this case load the UI for a different window) depending on what it says.