我更新了react-router-dom
(其中更新了react-router
),现在我的应用程序崩溃并显示以下消息:
警告:React.createElement:类型无效-预期为字符串(对于内置组件)或类/函数(对于复合组件),但得到了:对象。 检查LoadableComponent的渲染方法。
const Dashboard = Loadable({ loader: () => import(/* webpackChunkName: "Dashboard" */ "./components/dashboard/Dashboard"), loading });
class Dashboard extends Component {} export default withTranslation()(connect(select)(Dashboard));
class App extends Component {
render() {
return (
<Provider store={store}>
<Router history={history}>
<Switch>
<Route path="/" render={props => <Dashboard {...props}/>} />} />
</Switch>
</Router>
</Provider>
);
}
}
export default hot(module)(App);