1.0.7 • Published 3 years ago
generate-react-redux-cli v1.0.7
Generate-React-Redux-Cli
A simple CLI to generate react components and create redux store, actions, and reducers
Install
npm i -g generate-react-redux-cli
Usage
Note: create reducer before creating store.
Flags | Description | Value Type |
---|---|---|
c | to create component | |
r | to create a reducer | |
s | to create a redux store | |
a | to create an action | |
-p | to specify a path | |
-t | type of a component | functional/class |
To create a component
generate-react-redux c Example
Example of the component files structure
|-- /src
|-- /components
|-- /Example.jsx
To create a reducer
generate-react-redux e ExampleReducer
Example of the component files structure
|-- /src
|-- /reducers
|-- /ExampleReducer.js
|-- /rootReducer.js
To create a store
generate-react-redux s
Example of the component files structure
|-- /src
|-- /store
|-- /index.js
To create an action
generate-react-redux a ExampleAction
Example of the component files structure
|-- /src
|-- /actions
|-- /ExampleAction.js
Options
path e.g src/components
generate-react-redux c Example -p src/pages/components
Example of the component files structure
|-- /src
|-- /pages
|-- /components
|-- /Example.jsx
generate-react-redux c Example -p src/pages/components
Example of the component
generate-react-redux c Example -p src/pages/components -t class