Using Configuration
With the above steps, you can now create a configuration file which will be used by rnhc
to create your files with your custom config.
- To create a default configuration file run:
rnhc create --config
- This will create a
rnhc.config.json
file at the root of your project. The file will contain the following:
{
"withStyles": true,
"withFunctions": true,
"withProps": true,
"withTests": true,
"defaultExports": true,
"componentsRoot": "./src/components",
"screensRoot": "./src/screens",
"reduxRoot": "./src/redux",
"applyReduxThunk": true
}
withStyles
: if true, createstyles.js
(orstyles.ts
) file for components and screens, if false, don't createstyles.js
(orstyles.ts
) file, default is true.withFunctions
: if true, createfunctions
folder for screens, if false, don't createfunctions
folder, default is true.withProps
: if true, create propsinterface
for components and screens (in TS only), if false, don't create propsinterface
, default is true.withTests
: if true, create__tests__
folder for components and screens, if false, don't create__tests__
folder, default is true.defaultExports
: if true, create default export for components and pages, if false, create named export for components and pages, default is true.componentsRoot
: the root folder for components, default is./src/components
.screensRoot
: the root folder for screens, default is./src/screens
.reduxRoot
: the root folder for redux, default is./src/redux
.applyReduxThunk
: if true, applyredux-thunk
middleware to the store, if false, don't applyredux-thunk
middleware, default is true.
- If no configuration file is found or you don't specify some of the configuration, the default configuration will be used.