Mmanishjha-04

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

No description available

react-routermigrationv6
Public
0 executions

Run locally

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

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.