M

react-router/6/reorder-matchpath-args

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 reorders the arguments in the matchPath function calls. It switches the position of the string path and the second callback argument, improving consistency and readability.

Before

tsx

After

tsx

This change ensures that the string path is now the second argument, following the newer convention for using matchPath.

Ready to contribute?

Build your own codemod and share it with the community.