npx react-router-v6-codemods link-to-props path/of/files/ or/some**/*glob.js
# or
yarn global add react-router-v6-codemods
react-router-v6-codemods link-to-props path/of/files/ or/some**/*glob.js
node ./bin/cli.js link-to-props path/of/files/ or/some**/*glob.js
Input (basic.input.js):
<Link to={{ pathname: '/home', state: state }} />;
Output (basic.output.js):
<Link to="/home" state={state} />;