A Yeoman generator for generating React components.
npm install generator-react2
yo react MyComponent ./path/to/components
By default yo-react will generate a stateful component with the following directory structure
/path/to/components
| MyComponent
| MyComponent.js
| MyComponent.spec.js
| index.js
yo-react require two arugments
- component name
- path to component's folder
yo react [componentName] [/path/to/components]
-
--stateless
(Boolean) - will generate a stateless functional component when set to true -
--propTypes
(Array) - will generate a list of propTypes. This is compatiable with Immutable.js -
--methods
(Array) - will generate component methods -
--info
(String) - will generate component info documentation
MIT