我正在尝试按照this article中的说明在React Redux中实现404页面。我的路线如下:
import React from "react";
import {Provider} from "react-redux";
import {ConnectedRouter} from "react-router-redux";
import {Route} from "react-router";
import RootContainer from "../containers/RootContainer"
import NotFoundComponent from "../components/NotFoundComponent";
const routes = (history, store) => {
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<div>
<Route path="/" component={RootContainer}/>
<Route path="*" component={NotFoundComponent}/>
</div>
</ConnectedRouter>
</Provider>
);
};
export default routes;
在此之后,我意识到NotFoundComponent
一直泄漏到RootContainer
。知道为什么会这样吗?