npm i rnx-gen --save-dev
npx rnx-gen g screen UserProfile
src
|-screens
|-UserProfileScreen
|-__tests__
|-UserProfileScreen.test.ts
|-UserProfileScreen.tsx
|-UserProfileScreen.types.ts
|-UserProfileScreen.styles.ts
|-UserProfileScreen.constants.ts
|-index.ts
Option | Descriptions |
---|---|
--no-test | Do not create the tests folder and the test file |
--no-const | Do not create the constants file |
--no-style | Do not create the styles file |
--path | Custom path beginning with src (example --path=src/screens/auth) |
npx rnx-gen g component AlertModal
src
|-components
|-AlertModal
|-__tests__
|-AlertModal.test.ts
|-AlertModal.tsx
|-AlertModal.styles.ts
|-index.ts
Option | Descriptions |
---|---|
--no-test | Do not create the tests folder and the test file |
--no-dir | Do not create a separate folder for the component |
--no-style | Do not create the styles file |
--path | Custom path beginning with src (example --path=src/components/cards) |
npx rnx-gen g hook profileData
src
|-hooks
|-useProfileData
|-useProfileData.ts
|-useProfileData.test.ts
|-index.ts
Option | Descriptions |
---|---|
--no-test | Do not create the test file |
--no-dir | Do not create a separate folder for the hook |
--path | Custom path beginning with src (example --path=src/hooks/data) |
npx rnx-gen g slice users
src
|-redux
|-slices
|-usersSlice.ts
Option | Descriptions |
---|---|
--path | Custom path beginning with src (example --path=src/redux/reducers) |
npx rnx-gen redux
src
|-redux
|-slices
|-appSlice.ts
|-selectors
|-appSelectors.ts
|-rootReducer.ts
|-store.ts
|-store.utils.ts