Adding React Router v7 to Nx Monorepo #29603
digibake
started this conversation in
Feature Requests
Replies: 1 comment
-
A React Router plugin for @nx/react has landed in nx v21: You can generate an application using @nx/react:app generator options: nx g @nx/react:app --routing --useReactRouter Note that, as of now, it has no support for react-router generated +types, this requires a manual adjustment of your project: The following setup works fine for me: {
// ...
"targets": {
"typecheck": {
"dependsOn": ["typegen"]
},
"typegen": {
"cache": true,
"executor": "nx:run-commands",
"inputs": [
"production",
"^production",
{
"externalDependencies": ["@react-router/dev"]
}
],
"options": {
"command": "react-router typegen",
"cwd": "replace/with/path/to/your/app"
}
}
}
} |
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.
-
The new version of Remix is now React Router v7. I'd like to upgrade from Remix but I've lost days now trying to get React Router v7 to work with Nx because the existing Nx recipes are for Remix. Could anyone give me some pointers where to start?
Beta Was this translation helpful? Give feedback.
All reactions