|
| 1 | +# react-native-screens |
| 2 | + |
| 3 | +This project is a react-native library, focused on exposing native |
| 4 | +navigation containers and implementing common navigation paradigms |
| 5 | +such as stack, tabs, split. |
| 6 | + |
| 7 | +## Repository layout tips |
| 8 | + |
| 9 | +- `./src/` - JS side of the library |
| 10 | + |
| 11 | + - `./src/components/gamma/` - each directory inside contains JS code for new |
| 12 | + components, planned for next major release, |
| 13 | + - `./src/components/safe-area/` - code related to `SafeAreaView` component, |
| 14 | + - `./src/components/tabs/` - code related to `TabsHost` & `TabsScreen` components, |
| 15 | + |
| 16 | + - `./src/fabric/` - _codegen_ specs for the components used by the |
| 17 | + native code generation tool |
| 18 | + |
| 19 | +- `./android/` - Android part of the library implementation, |
| 20 | +- `./ios/` - iOS part of the library implementation, |
| 21 | +- `./cpp/` and `./common/` - C++ layer, shared between Android and iOS parts, |
| 22 | +- `./FabricExample/` - contains an example application, we use it to showcase the library |
| 23 | + capabilities and test the library. It is not published as part of the package. |
| 24 | + |
| 25 | +- `./apps/` - extracted JS (react-native) code of the `FabricExample` application; |
| 26 | + this is done to share the code with other example applications in the repository. |
| 27 | + |
| 28 | +- `./react-navigation/` - this is a git submodule for a downstream library providing |
| 29 | + a complete navigation solution. It is not part of the library. |
| 30 | + |
| 31 | +## Code conventions |
| 32 | + |
| 33 | +- TypeScript-first. Always prefer TypeScript over JavaScript unless explicitly working in a JS-only context. |
| 34 | +- PascalCase for component names, camelCase for hooks (e.g., `useTabsNavigationContext`). |
| 35 | +- Use context hooks when a context exists — do not pass context values as props. |
| 36 | + |
| 37 | +## Imports |
| 38 | + |
| 39 | +- Use relative imports within library packages (`./src/`). |
| 40 | +- Use path aliases (`@apps/*`, `@assets/*`) only in example apps (`./apps/`, `./FabricExample/`). |
| 41 | +- Never use absolute paths from project root as import paths. |
| 42 | + |
| 43 | +## Git & refactoring |
| 44 | + |
| 45 | +- When renaming or deleting across the codebase, always grep for ALL references |
| 46 | + before committing. Verify zero stale references remain after the change. |
| 47 | + |
| 48 | +## Code review guidelines |
| 49 | + |
| 50 | +Be extremely frank and focused on thoroughness. |
0 commit comments