You should not use Route or withRouter() outside a Router when using react-router 4 and styled-component in react

后端 未结 5 842
走了就别回头了
走了就别回头了 2020-12-18 17:57

I\'m trying to build my first portfolio website and got stuck in routing using react-router-dom 4.2.2 and styled-components 2.2.3.

error message: You should

5条回答
  •  感情败类
    2020-12-18 18:15

    This may be a result of some confusions in node_modules for multirepo projects with some integration approaches.

    The simplest way to avoid problems is to keep only one node_modules folder for all projects integrated together in one application. Otherwise some subproject can use different versions of same library (as example React or Router etc) which can be not compatible with each other in internal data structs (react contexts and so on) and that brings problems like this.

提交回复
热议问题