M

react-router/6/seperate-link-state-prop

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 simplifies the Link component by transforming its to prop from an object with a pathname to a string. It removes the unnecessary object wrapper around the pathname, maintaining the state prop as is.

Before

tsx

After

tsx

This change enhances the readability of your Link components by using a more straightforward string representation for the to prop, aligning with current best practices in React Router.

Ready to contribute?

Build your own codemod and share it with the community.