Generates some react component and other stuff.
This is a tool to generate react component skeletons.
It can generate stateless function components, es6 class components, and components that are connected to Redux store.
The format is pretty specific to a particular project I work on. Please submit an issue if you actually use this and want to be able to configure file extensions and whatnot.
First, install Yeoman and generator-react-stuff. If you are unfamiliar with Yeoman, have a read.
# or npm
yarn install -g yo
yarn install -g generator-react-stuff
To perform set up (required), run in the root of your project:
yo react-stuff
You'll be asked a couple of questions to determine where files should be placed within your project.
- Component root
- Whether you want to extend class style components from
Component
orPureComponent
Please note that this will create a .yo-rc.json
in your project root. Add this to your gitignore if you need to.
Please run commands in the root of your project.
yo react-stuff:component
Options:
- Name
- Stateless function vs class
- CSS file
- Additional path to where the component folder should be placed
E.g. if your component root was set up as ./src/components
, and you specify additional path of pages
, the new component folder will be ./src/components/pages/MyComponent
Output:
MyComponent/
MyComponent.jsx
MyComponent.css
yo react-stuff:container
Options:
- Name
- CSS file
- Additional path to where the component folder should be placed
MIT © Tyler Crammond