browser.js: 警告: [react-router]
History
mixin は非推奨です。context.router
独自の でアクセスしてくださいcontextTypes
。
私のルートファイル
const routes = (
<Provider store={store}>
<Router history={browserHistory}>
<Route path="/" component={RootComponent}>
<IndexRoute component={HomePage} />
<Route path="profile" component={ProfilePage} >
<IndexRoute component={ProfilePage} />
<Route path="view/:profileId" component={ProfilePage} />
<Route path="add" component={AddProfile} />
<Route path="edit/:profileId" component={EditProfile} />
</Route>
<Route path="login" component={Login} />
<Route path="onboard" component={Onboard} />
</Route>
</Router>
</Provider>
);
export default routes;
そしてルート
import React from 'react';
import { render } from 'react-dom';
import routes from './routes';
import "babel-polyfill";
const mountPoint = document.getElementById('application-root');
if (mountPoint) {
render(routes, mountPoint);
} else {
console.error('could not find application mount point');
}
React-router v2.6.1