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