react-router-v6-codemods
v0.6.0
Published
![Build and Deploy](https://github.com/rajasegar/react-router-v6-codemods/workflows/CI/badge.svg) [![npm version](http://img.shields.io/npm/v/react-router-v6-codemods.svg?style=flat)](https://npmjs.org/package/react-router-v6-codemods 'View this project o
Downloads
13
Maintainers
Readme
react-router-v6-codemods
A collection of codemods for react-router for upgrading to v6.
Usage
To run a specific codemod from this project, you would run the following:
npx react-router-v6-codemods <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
# or
yarn global add react-router-v6-codemods
react-router-v6-codemods <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
Local Usage
node ./bin/cli.js <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
Transforms
- compat-route
- compat-router
- link-to-props
- match-path-arguments
- navlink-exact-end
- redirect-to-navigate
- remove-active-classname
- remove-active-style
- remove-compat-router
- remove-go-hooks
- remove-redirect-inside-switch
- rename-compat-imports
- static-router-imports
- use-location
- use-navigate
- use-params
- use-route-match
Contributing
Installation
- clone the repo
- change into the repo directory
yarn
Running tests
yarn test
Update Documentation
yarn update-docs