npx react-router-v6-codemods remove-active-classname path/of/files/ or/some**/*glob.js
# or
yarn global add react-router-v6-codemods
react-router-v6-codemods remove-active-classname path/of/files/ or/some**/*glob.js
node ./bin/cli.js remove-active-classname path/of/files/ or/some**/*glob.js
Input (basic.input.js):
const MyApp = ({ title }) => {
return (
<NavLink to="/messages" className="nav-link" activeClassName="activated">
Messages
</NavLink>
);
};
Output (basic.output.js):
const MyApp = ({ title }) => {
return (
<NavLink
to="/messages"
className={(
{
'isActive': isActive
}
) => 'nav-link' + (isActive ? ' activated' : '')}>
Messages
</NavLink>
);
};