React Native & Expo Best Practices
Comprehensive guide for Expo and React Native development using TypeScript. Contains rules prioritized by impact on maintainability, performance, and scalability.
When to Apply
Reference these guidelines when:
- •Structuring the project folders or adding new features (
app/vscore/vscomponents/). - •Creating UI components, deciding between integral or base/presets patterns.
- •Implementing data fetching logic using
react-query-kitandaxios. - •Defining TypeScript interfaces or segregating domain types from library typings.
- •Styling components using NativeWind (
className) and handling conditional styles. - •Configuring Expo plugins, environment variables, or native directories.
- •Writing functional helpers or configuring global store hooks.
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Architecture & Core Structure | CRITICAL | arch- |
| 2 | Project Configuration | MEDIUM-HIGH | conf- |
Quick Reference
1. Architecture & Core Structure (HIGH)
- •
arch-folder-structure- Enforce strict separation ofapp(Expo Router),core(Logic), andcomponents(UI) - •
arch-components-structure- Standards for Integral components vs the base/presets pattern for variants - •
arch-typing-system- Segregate domaintypesfrom librarytypingsusing explicit imports - •
arch-core-utilities- Functional helpers, centralized config constants, and library adapters
2. UI Engineering & Styling (HIGH)
- •
arch-style-nativewind- UseclassNamewith NativeWind andclassnamesfor conditional logic
3. Data & Configuration (MEDIUM-HIGH)
- •
arch-api-data-layer- Centralized Axios andreact-query-kitwith safe return patterns - •
conf-expo- Native config via plugins, strict Prettier sorting, and clean-state scripts
4. Coding Standards (LOW)
- •
arch-syntax-conventions- Short-hand iterators (uvsuser), single-line type definitions, and event handler naming (handle*vson*)
How to Use
Read individual rule files for detailed explanations and code examples:
plaintext
rules/*.md