Unable to Use SSR with Loaders in react-router-compat Due to Missing Server Methods #10794
Unanswered
diki
asked this question in
v5 to v6 Migration
Replies: 0 comments
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.
-
Hola,
We have been working on migrating from react-router-dom v5 to v6 in our monorepo. In this process, we've tried to use the react-router-compat package to ease the migration, but noticed that server-side rendering (SSR) methods from v6 aren't available in the compat package.
Our monorepo is sizable, so a complete, immediate upgrade is challenging. To bridge the gap, we even tried manually integrating server.tsx from the react-router-dom v6 repository, but we've encountered type errors tied to the underlying react-router package.
Additionally, our attempt to alias npm modules for both v5 and v6 presented challenges, particularly because internal dependencies in the modules themselves (even when aliasing react-router-dom@5 to react-router-dom-v5) end up pulling in react-router@6 due to dependencies from react-router-dom@6.
My question is, how can we achieve SSR with loaders using the react-router-compat package?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions