Using react-router-dom's Link from the external package inside Remix #6359
Unanswered
pkalisiewicz
asked this question in
Q&A
Replies: 2 comments
-
any news on this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I experienced the same issue, found this answer on stack-overflow that helped me work around it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use
react-router-dom
inside our internal package, for example, we consumeLink
fromreact-router-dom
that is being used in Remix. This is a shared component library, so I don't want to include Remix in it.I have been using this configuration for a long time, although after the latest update to Remix (any change above Remix 1.10), it started throwing me the error of missing context.
Anyone can help me out with it?
Previously I created an issue, although it was closed and I have been told to use the
Discussions
tab.Here is the exact scenario:
What version of Remix are you using?
1.16.0
Are all your remix dependencies & dev dependencies using the same version?
Steps to Reproduce
Expected Behavior
The Link component should render a component without any issues. This is because it should be using the upper context created by
RemixBrowser
(client-side) andRemixServer
(server-side).Actual Behavior
The application breaks when using the Link component from react-router-dom directly in a Remix app. The error message mentions the missing context for the library's basename.
To better understand the issue, please refer to the following StackBlitz example
https://stackblitz.com/edit/remix-run-remix-kdzgmg?file=package.json,app%2Froutes%2F_index.tsx
Beta Was this translation helpful? Give feedback.
All reactions