Electron and routing


#1

Hi all, i’m a bit confused on how traditional routing in web apps applies to Electron apps.

I was chatting in the node.js IRC about this, and got some conflicting feedback.

Usually, routing matches the current url to which views (and in the case of React, which Components) are to be rendered. As far as I know, Electron does not have the same concept of URLs as a web app would have.

So the core question is, how do you dynamically load different Components for things like in app navigation? Is something like react-router suppose to be used as it normally would in a web app? Or is there some other way to dynamically load your Components?

Thanks!


#2

It does have a sense of URLs, and should just function as it would on the web.

That being said, I’m not privy to the ins-and-outs of how react-router works, so maybe there are some issues with it.

I do know, however, that Angular’s hash-based routing works. You could probably work around old-school routing with a bit of Node. But routing React, should be child’s play.