react-refactor-cli
v1.0.0
Published
Convert your React Class Component to Functional Component and vice-versa
Downloads
20
Readme
react-refactor
How many times have you converted a React Class component to a React Functional component and vice-versa? It’s a boring task, and we know... "developers don’t like boring tasks". Thanks to React Refactor you can convert any React component from and to Class component.
It's made with Babel Babylon and thanks to string replacing it’s able to instantly convert your component to the opposite kind of component that you provided.
React Refactor is available in three different packages: Library, CLI, Web Interface
Library
The package react-refactor offers methods to programmatically convert a component. You can use it to make new useful utilities that integrate this ability.
const {execRefactor} = require('react-refactor')
let {output} = execRefactor(source)
CLI
You can globally install the package react-refactor-cli and use it to convert your component on the fly.
$ yarn global add react-refactor-cli
$ react-refactor [--output <filename>] <filename>
Web interface
You can avoid installing anything and convert your component through the web interface available at https://chrvadala.github.io/react-refactor/
Changelog
- v0.0 - Preview version
- v1.0 - First stable version
Run tests
yarn install
yarn run bootstrap
yarn build
yarn test
yarn run clean
Contributors
- chrvadala (author)