求助:AssertionError: ...libraryName should be provided
来源:20-4 使用 React Router 4 重写项目(三)
F_Gump
2018-04-16
突然之间就编译不过了。。。
2回答
-
F_Gump
提问者
2018-04-16
import React from 'react';
import ReactDOM from 'react-dom';
import MediaQuery from 'react-responsive';
import { Route, BrowserRouter, Switch } from 'react-router-dom';
import 'antd/dist/antd.css';
import PCIndex from './components/pc_index';
import PCNewsDetails from './components/pc_news_details';
import MobileNewsDetails from './components/mobile_news_details';
import MobileIndex from './components/mobile_index';
import PCUserCenter from './components/pc_usercenter';
import MobileUserCenter from './components/mobile_usercenter';
export default class Root extends React.Component {
render() {
return (
<div>
<MediaQuery query="(min-device-width: 1224px)">
<BrowserRouter>
<Switch>
<Route exact path="/" component={PCIndex} />
<Route path="/details/:uniquekey" component={PCNewsDetails} />
<Route path="/usercenter" component={PCUserCenter} />
</Switch>
</BrowserRouter>
</MediaQuery>
<MediaQuery query="(max-device-width: 1224px)">
<BrowserRouter>
<Switch>
<Route path="/" component={MobileIndex} />
<Route path="/details/:uniquekey" component={MobileNewsDetails} />
<Route path="/usercenter" component={MobileUserCenter} />
</Switch>
</BrowserRouter>
</MediaQuery>
</div>
);
}
}
ReactDOM.render(<Root />, document.getElementById('mainContainer'));012018-04-19 -
Parry
2018-04-16
同学你好,请贴一下root.js的代码。
00
相似问题