LoginSignup
1
0

More than 5 years have passed since last update.

【React】Linkが使えない!

Posted at

以下のエラーが出た。Linkがどうしても使えない。。

Warning: Failed context type: The context `router` is marked as required in `Link`, but its value is `undefined`.

どなたかが書いていたのですが、

Found it -- my bad! I had the component appearing outside the Router component!
https://github.com/ReactTraining/react-router/issues/4639

とあり、Linkの場所をよくみてみると、BrowserRouterコンポーネントの外に出てしまっていた。
BrowserRouterコンポーネントの中に入れてあげたらちゃんと画面が表示されるようになった。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0