Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
129
rated 0 times [  130] [ 1]  / answers: 1 / hits: 67271  / 8 Years ago, fri, april 8, 2016, 12:00:00

Using this boilerplate as reference I created an Electron app. It uses webpack to bundle the scripts and express server to host it.



Webpack config is practically same as this and server this.



Electron's script loads:



mainWindow.loadURL('file://' + __dirname + '/app/index.html');



And index.html loads the script hosted by the server:



<script src=http://localhost:3000/dist/bundle.js></script>



I run electron index.js to build the app and node server to start server which using webpack bundles the scripts.



It works fine, my React component App is mounted. But how I integrate react-router into this?



I implemented it the same way I would in a browser app. I get this error:



[react-router] Location /Users/arjun/Documents/Github/electron-app/app/index.html did not match any routes



It is taking file path as the route. Going through the boiler plate code did not help. What am I missing?


More From » reactjs

 Answers
13

Another option would be to use hashHistory instead. Actually, in your referenced repo you can see that they're using hashHistory, how about trying that and posting back?


[#62645] Wednesday, April 6, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
johnnyblaynes

Total Points: 667
Total Questions: 121
Total Answers: 102

Location: Anguilla
Member since Sat, Jan 23, 2021
3 Years ago
;