<Link/>
cannot be rendered outside <Router/>
but doesn't tell me about that
#12989
Labels
<Link/>
cannot be rendered outside <Router/>
but doesn't tell me about that
#12989
I'm using React Router as a...
library
Reproduction
Sorry for not providing more but it's not necessary, really. The
<Link />
component doesn't seem to have the same check as React Router hooks, resulting in a degrading DX.System Info
Used Package Manager
npm
Expected Behavior
I expect this unintentionally incorrect usage to throw the same error as I get when using React Router hooks without the
<Router />
context:This will be a more meaningful error message and will help me figure out what I'm doing wrong, as opposed to the internal "cannot read from context because context doesn't exist", which doesn't tell me much.
Actual Behavior
The following, user-unfriendly error is being thrown:
I know this error has been raised before in #11237 and #10867, none of which were actually solved for developers also due to this error being semi-cryptic.
The text was updated successfully, but these errors were encountered: