This will create a folder in the current working directory with the provided component name and generate component files.
$ rg component <type> <componentName> [options]
- Arguments:
type
- the type of component- acceptable values:
rfc
- react functional componentrcc
- react class componentrccp
- react class component with proptypesrfcp
- react functional component with proptypesrafc
- react arrow functional componentrafcp
- react arrow functional component with proptypesrafcredux
- react arrow functional component with connected reduxrafcreduxp
- react arrow functional component with connected redux & proptypesrfcredux
- react functional component with connected reduxrfcreduxp
- react functional component with connected redux & proptypes- more types coming soon
- acceptable values:
componentName
- component name in kebab-case, will be converted to PascalCase- acceptable values:
- any type as long as it is kebab-case
- acceptable values:
- Options:
--css
- css extension type- acceptable values:
css
- a general css file with a .css extensionless
- a general css file with a .less extensionscss
- a general css file with a .scss extension
- default value:
css
- acceptable values:
--cssType
- type of css file- acceptable values:
normal
- a general css filemodular
- modular css files to allow scoping of css
- acceptable values:
--test
- decides if you want to generate a test file along with the component files.- acceptable values:
true
false
- default value:
false
- acceptable values:
--testExt
- test file extension type- acceptable values:
test-js
test-tsx
spec-js
spec-tsx
- default value:
test-js
- acceptable values:
--cwd
- pass a string if you want to change the current working directory.- acceptable values:
- string
- acceptable values:
--ext
- component file extension type- acceptable values:
js
jsx
tsx
- default value:
js
- acceptable values: