M

react-router/6/remove-activeStyleprops

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 NavLink components that use separate style and activeStyle props to the modern isActive function in react-router-dom. It simplifies the logic by combining the two props into a single style prop with conditional styling.

Before

tsx

After

tsx

This makes the component more concise and aligns it with the newer API for conditional styles based on the isActive property.

Ready to contribute?

Build your own codemod and share it with the community.