yarn add --dev react-spawn
# or
npm install --save-dev react-spawn
Add "scripts": { "spawn": "react-spawn" }
in your package.json
Now npx spawn ComponentName
will create a ComponentName
directory in src/components
.
If a .spawn-templates
directory exists inside your app root it'll be used in place of default-templates.
Every occurrence of __name__
in file names or in their content will be replaced with the component name.