如何解决无法阅读财产的听众'在reactjs中为null

时间:2017-11-15 06:09:58

标签: reactjs react-redux

我正在为我的React项目使用以下软件包。

    "react-redux": "^4.4.5",
    "react-router": "3.0.0",
    "react-cookie": "1.0.4",
    "react-dom": "^15.4.1",
    "react":"^15.4.1"

在componentWillMount函数中,我检查我的cookie值,如果它不匹配,我只需转发到我的主页。

对于转发页面,我正在使用

hashHistory.push('/');

我在这里收到错误

error TypeError: Cannot read property 'listeners' of null
at ReactDOMComponent.unmountComponent (ReactDOMComponent.js:966)
at Object.unmountComponent (ReactReconciler.js:78)
at Object.unmountChildren (ReactChildReconciler.js:146)
at ReactDOMComponent.unmountChildren (ReactMultiChild.js:371)
at ReactDOMComponent.unmountComponent (ReactDOMComponent.js:990)
at Object.unmountComponent (ReactReconciler.js:78)
at Object.unmountChildren (ReactChildReconciler.js:146)
at ReactDOMComponent.unmountChildren (ReactMultiChild.js:371)
at ReactDOMComponent.unmountComponent (ReactDOMComponent.js:990)
at Object.unmountComponent (ReactReconciler.js:78)

我如何解决这个错误。请给出我的解决方案。

提前致谢。

0 个答案:

没有答案