react-router npm 中报了如下错误

在参照阮一峰react-router教程

学习的时候,按照教程打上去,运行后报如下错误:

./src/index.js

11:14-25 'react-router' does not contain an export named 'hashHistory'.

代码是这样写的:


import React from 'react';

import ReactDOM from 'react-dom';

import './index.css';

import App from './App';

import { Router, Route, hashHistory } from 'react-router';

import registerServiceWorker from './registerServiceWorker';


ReactDOM.render((

    <Router location={hashHistory}>

    <Route path="/" component={App}/>

  </Router>

    ), document.getElementById('root'));

registerServiceWorker();

好像是版本的问题,求大神帮忙解决一下!


慕哥6287543
浏览 453回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript