npx react-router-v6-codemods use-params path/of/files/ or/some**/*glob.js
# or
yarn global add react-router-v6-codemods
react-router-v6-codemods use-params path/of/files/ or/some**/*glob.js
node ./bin/cli.js use-params path/of/files/ or/some**/*glob.js
Input (basic.input.js):
function Project(props) {
const { params } = props.match;
}
Output (basic.output.js):
import { useParams } from 'react-router-dom-v5-compat';
function Project(props) {
const params = useParams();
}