Notes
- To see the available commands for
rnhcyou can run:
rnhc --help
- To see the available positionals and options for a specific command like
createyou can run:
rnhc create --help
- In order to
rnhcto work, you must be at the root of your React Native project. It will check and if somehow you are not at the root of the project,rnhcwill prompt:
You don't seem to be at the root of a react native project
In
createcommand,rnhcwill create files with the project's used language, so if the project is written with TypeScript, it will write files with TypeScript, the same apply for JavaScript.If you want to create files with a specific language you can add
--jsor--tsoptions at the end of yourcreatecommand, like this for example:
rnhc create -s test-screen --ts
- It is advisable to give the components, screens, reducers and actions with this case
some-name, for example:
rnhc create -s world-to-react
- You can always overwrite your implementation using the
--overwriteor-ooption, for example:
rnhc create -c test-component -o
rnhc create -s test-screen -o
rnhc create -r -o
rnhc create --reducer test-reducer -o
rnhc create --action test-reducer test-action -o
- This is helpful when you want to update your navigation files, for example you already have a navigation file in
src/screens/folder and you want to update it with the new screens you created:
rnhc create -n stack --overwrite
When creating reducers you should have already a redux implmentation created with
rnhc create -rso it can work.When creating actions, you should have already a redux implementation created with
rnhc create -ras well as an existed reducer withrnhc create --reducer <reducer-name>so it can create actions for that specific reducer.Creating and deleting reducers and actions will not just delete files, but also update other files that depends on them under the
src/redux/folder (Or your specified path for the root of redux folder inrnhc.config.json).