使用this boilerplate作为参考我创建了一个Electron应用程序。它使用webpack捆绑脚本,并使用express服务器来托管它。如何使用带电子的React路由器?
电子的脚本加载:
mainWindow.loadURL('file://' + __dirname + '/app/index.html');
和index.html加载由服务器托管的脚本:
<script src="http://localhost:3000/dist/bundle.js"></script>
我跑electron index.js
构建应用程序和node server
启动服务器其中使用webpack捆绑脚本。
它工作正常,我的React组件应用程序被挂载。但是,我如何将反应路由器集成到此?
我在浏览器应用程序中以相同的方式实现它。我得到这个错误:
[react-router] Location "/Users/arjun/Documents/Github/electron-app/app/index.html" did not match any routes
它正在文件的路径作为路由。通过锅炉板代码没有帮助。我错过了什么?
获取完全相同的东西。你有没有找到一个解决方案,@ arjun-u - 或者你只是去hashHistory而不是? –
我使用了hashHistory。 –