未调用的组件不断泄漏到其他组件中

时间:2017-05-26 14:36:33

标签: reactjs react-redux react-router-redux react-router-v4 react-router-dom

我正在尝试按照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。知道为什么会这样吗?

0 个答案:

没有答案