TypeScript in RN Highlights Summary
Every highlight bullet from the 9 pages in this section, gathered on one page and grouped by the page it came from.
Busca en todas las páginas de la documentación
Every highlight bullet from the 9 pages in this section, gathered on one page and grouped by the page it came from.
expo/tsconfig.base and keep strict: true - Expo scaffolds already ship this layoutComponentNameProps; avoid React.FC because it adds implicit childrenStyleProp<ViewStyle> when a component accepts style overrides or style arraysuseLocalSearchParams() hides missing keysunknown until Zod validates it; z.infer keeps runtime and compile-time in syncPick, Omit, and ComponentProps derive shapes from one source instead of duplicate interfacesres.json() as unknown until a Zod schema parses it - compile-time types alone do not survive the wirez.infer<typeof Schema> is the single source of truth for both runtime checks and TypeScript exportssafeParse at UI boundaries and parse in trusted fetch helpers where you want exceptions to bubble.extend, .pick, and z.discriminatedUnion so list and detail endpoints share field definitionsqueryFnStyleProp<ViewStyle> accepts a single style, an array, or falsy entries - match what RN components already acceptComponentProps<typeof Pressable> forwards every native prop without maintaining a hand-written listOmit to replace children or style when your wrapper exposes a narrower APIPressableProps['style'] captures the function-style callback Pressable allows - do not narrow to ViewStyle aloneComponentProps<typeof TextInput>['onChangeText']) instead of guessing signaturesexperiments.typedRoutes in app config - default Expo Router templates on SDK 57 often ship with this already onnpx expo start runs - output lands in .expo/types and expo-env.d.tsHref autocomplete catches typos in <Link href> and router.push at compile timeparams - string templates alone are not enoughnpx expo customize tsconfig.json on CI so typecheck works without starting Metro.js → .ts / .tsx file by file - allowJs: true lets JS and TS coexist during migrationstrictNullChecks first; it catches the most real mobile bugs (undefined params, missing API fields)// @ts-expect-error with a ticket comment - it fails the build when the underlying error is fixedtsc --noEmit error count per folder - shrink the blast radius sprint over sprintRevisado por Chris St. John·Última actualización: 19 jul 2026