React Router/7/Migration Recipe
Made for
React-router
Last update
Dec 17, 2024
This codemods designed to facilitate the migration of your project from React Router to version 7. Each codemod targets specific changes and improvements introduced in React Router v7, ensuring a smoother transition.
Included Codemods
The following codemods are included in this recipe:
-
react-router/7/relative-links
Updates relative link paths to comply with v7 standards. -
react-router/7/add_v7_relativeSplatPath_Flag
Adds therelativeSplatPathflag to routes to support relative splat behavior. -
react-router/7/errorfirst-mutation-reorder
Reorders error-first mutation signatures for compatibility with v7. -
react-router/7/form-methods-post-get-to-uppercase
Converts form method strings (post,get) to uppercase as required by v7. -
react-router/7/route-wildcard-to-nested
Transforms route wildcards into nested routes for improved routing management. -
react-router/7/add_v7_startTransition_Flag
Introduces thestartTransitionflag to enhance transitions in routing. -
react-router/7/add_v7_fetcherPersist_Flag
Adds thefetcherPersistflag to improve data fetching mechanisms. -
react-router/7/add_v7_normalizeFormMethod
Normalizes form methods to align with v7 conventions. -
react-router/7/add_v7_partialHydration_Flag
Integrates thepartialHydrationflag to support enhanced hydration strategies. -
react-router/7/add_v7_skipActionStatusRevalidation_Flag
Adds theskipActionStatusRevalidationflag for improved action handling.
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community