Nothing on this page matches that. Check the list under the search box for matches on other pages.
Components
C1MUST build UI from shared/ui primitives once they exist (Text, Button, Screen). NEVER style raw Text with ad-hoc fonts in a feature. shared/ui starts with only what the first screens use; text, buttons and the screen wrapper are the one exception to P2, since every screen needs them.
C2MUST keep one job per component. Split when a file passes ~200 lines, or when it mixes data fetching with layout: the screen fetches, children render from props.
C3MUST type every prop; NEVER any. Booleans read as isX / hasX, callbacks as onX.
C4MUST prefer composition (children, slots) over configuration. A component with a 4th boolean variant prop gets split (P6).
C5MUST use Pressable, or Gesture Handler’s new Touchable component (v3) if the repo uses Gesture Handler. NEVER the legacy core or Gesture Handler Touchable* components in new code.
C6MUST keep every interactive element accessible: accessibilityRole (or the ARIA role prop, which takes precedence) on every pressable, an accessibilityLabel when there is no visible text, touch targets of at least 44×44 pt on iOS and 48×48 dp on Android (use hitSlop), and font scaling left on for body text. NEVER allowFontScaling={false} to fix a layout; fix the layout.
C7MUST handle insets with react-native-safe-area-context, never the deprecated core SafeAreaView or hardcoded notch padding.
C8MUST give every remote image an explicit size. Expo projects use expo-image (disk and memory caching, placeholders); bare projects use core Image until caching is a measured problem, then vet a library (V1–V8).
C9NEVER add an i18n library before a second language is planned (N3). If the repo already has one, every user-facing string goes through it.
Styling
SY1MUST take colors, spacing, radius and typography from shared/theme tokens. NEVER hex values or magic numbers in feature code. The token set starts small (about 8 colors, a 4-pt spacing scale, 3–4 text styles) and grows only when a design needs a new value.
SY2MUST name tokens by role, not by value: colors.textPrimary, colors.danger, not blue500. This makes dark mode a token swap if product ever asks for it; NEVER build dark mode before then.
SY3MUST use StyleSheet.create, or the repo’s styling system (A2). Where the styles live depends on size: a small component keeps them at the bottom of its own file; once the styles block passes ~40 lines or the file passes ~150 lines, they move to a sibling ComponentName.styles.ts. One styles file per component, never a shared feature-wide styles file. Inline styles only for values computed at runtime.
SY4MUST lay out with flexbox and gap. NEVER absolute positioning for page layout. Read screen size with useWindowDimensions, never Dimensions.get at module level.
SY5MUST use the platform shadow props for a simple shadow and boxShadow when it must look the same on iOS and Android. boxShadow, filter and backgroundImage are stable in current React Native but need the New Architecture and carry platform limits (inset shadows need Android 10+, blur and dropShadow filters need Android 12+), so check the installed version’s notes before using them (A5). NEVER ship a prop the docs mark experimental.
SY6MUST put small platform differences in Platform.select inside the style. Split into .ios.tsx / .android.tsx files only when the components truly differ.