React-router: TypeError: Cannot set property 'props' of undefined

前端 未结 2 1287
既然无缘
既然无缘 2020-12-10 02:02

I am trying to set up routing in Meteor using react-router package and have encountered the following TypeError:

2条回答
  •  -上瘾入骨i
    2020-12-10 02:51

    Assuming you are importing Component as a React.Component correctly, try removing the parenthesis after Component.

    Should be:

    class Portfolio extends Component {
    

    instead of:

    class Portfolio extends Component () {
    

    If not, replace Componentwith React.Component.

提交回复
热议问题