Mmanishjha-04

react-router/6/switch-to-routes

No description available

Legacy
react-routermigrationv6
Public
0 downloads
0 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

This codemod updates Switch components to Routes in React Router, in line with React Router v6 and newer. It also adjusts the imports, replacing Switch with Routes in react-router-dom import statements.

Before

tsx

After

tsx

This codemod modernizes routing logic by using Routes instead of Switch, aligning your code with the latest practices in React Router.

Ready to contribute?

Build your own codemod and share it with the community.