Invariant failed: You should not use outside a

后端 未结 20 1437
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 20:55

I use react-router-dom for routing in my React application. Part of my app extracted in another package. List of dependencies looks like this:

20条回答
  •  天涯浪人
    2020-12-03 21:04

    Using the tag in a component that doesn't have the imported could give this error, try importing the BrowserRouter from 'react-router-dom'

    import {BrowserRouter , Link} from 'react-router-dom';
    

    then make sure to wrap your linked tags in the tag

提交回复
热议问题