私はちょうどElectronでデスクトップアプリケーションを作るために、私は電子とreact-routerを使用しようとしている方法を学び始めたが、私はエラー Warning: [react-router] Location "/" did not match any routes
使用して反応し、電子 - 反応 - ルータエラー
main.jsを得続けます
app.on('ready',() => {
win = new BrowserWindow({width: 800, height: 600});
win.loadURL(`file://${__dirname}/index.html`);
win.webContents.openDevTools();
win.on('closed',() => win = null);
})
routes.js
import App from './app';
import { Router, Route, hashHistory } from 'react-router';
import React from 'react';
const routes = (
<Router>
<Route path="/" component={App}/>
</Router>
);
の
index.js
import ReactDOM from 'react-dom';
import React from 'react';
import { Router, hashHistory } from 'react-router';
import routes from './routes';
ReactDOM.render(<Router routes={routes} history={hashHistory}/>, document.getElementById('app'));
app.js
import React, { Component } from 'react';
export default class App extends React.Component {
render() {
return (
<div>
{this.props.children}
</div>
);
}
}
私はこれを修正するために何ができますか?
あなたはこれを解決しましたか? – Kafo
@HusseinAlkafはい、私は、より具体的に表現するために、ノードのサーバーを作成しなければならなかった – corasan