Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajasegar/react-router-v4-codemods

Codemods for migrating react-router to v4
https://github.com/rajasegar/react-router-v4-codemods

codemod codemods react react-router

Last synced: 11 days ago
JSON representation

Codemods for migrating react-router to v4

Awesome Lists containing this project

README

        

# react-router-v4-codemods

![Build and Deploy](https://github.com/rajasegar/react-router-v4-codemods/workflows/CI/badge.svg)
[![npm version](http://img.shields.io/npm/v/react-router-v4-codemods.svg?style=flat)](https://npmjs.org/package/react-router-v4-codemods 'View this project on npm')

A collection of codemods for migrating to react-router v4.

## Usage

To run a specific codemod from this project, you would run the following:

```
npx react-router-v4-codemods path/of/files/ or/some**/*glob.js

# or

yarn global add react-router-v4-codemods
react-router-v4-codemods path/of/files/ or/some**/*glob.js
```

## Local Usage
```
node ./bin/cli.js path/of/files/ or/some**/*glob.js
```

## Transforms

* [add-exact-prop](transforms/add-exact-prop/README.md)
* [create-hash-history](transforms/create-hash-history/README.md)
* [hash-router](transforms/hash-router/README.md)
* [index-route](transforms/index-route/README.md)
* [remove-with-props](transforms/remove-with-props/README.md)
* [rename-imports](transforms/rename-imports/README.md)
* [wrap-with-switch](transforms/wrap-with-switch/README.md)

## Contributing

### Installation

* clone the repo
* change into the repo directory
* `yarn`

### Running tests

* `yarn test`

### Update Documentation

* `yarn update-docs`