M

react-router/5.1/redirect-to-navigate

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 deprecated Redirect components from react-router-dom to the modern Navigate API. It also updates the imports by replacing Redirect with Navigate.

Before

tsx

After

tsx

This change ensures compatibility with newer versions of react-router-dom by using Navigate in place of Redirect.

Ready to contribute?

Build your own codemod and share it with the community.