This codemod modernizes Route and Link components in React Router by:
- Removing the deprecated exact prop from Route.
- Updating Route to use the element prop.
- Rewriting dynamic Link and Route paths that use template literals like ${match.url} and ${match.path}.
Before
tsx
After
tsx
This ensures your code is compatible with newer versions of React Router, which no longer use exact and prefer the element prop for components. It also simplifies dynamic path generation by removing match references.