Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 893 Bytes

File metadata and controls

46 lines (33 loc) · 893 Bytes

use-params

Usage

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

Local Usage

node ./bin/cli.js use-params path/of/files/ or/some**/*glob.js

Input / Output


basic

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();
}