Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Official Expo team skills for building, deploying, and debugging Expo apps — fine-tuned for Claude Code.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/react-19.md
1# React 1923React 19 is included in Expo SDK 54. This release simplifies several common patterns.45## Context Changes67### useContext → use89The `use` hook replaces `useContext`:1011```tsx12// Before (React 18)13import { useContext } from "react";14const value = useContext(MyContext);1516// After (React 19)17import { use } from "react";18const value = use(MyContext);19```2021- The `use` hook can also read promises, enabling Suspense-based data fetching.22- `use` can be called conditionally, this simplifies components that consume multiple contexts.2324### Context.Provider → Context2526Context providers no longer need the `.Provider` suffix:2728```tsx29// Before (React 18)30<ThemeContext.Provider value={theme}>31{children}32</ThemeContext.Provider>3334// After (React 19)35<ThemeContext value={theme}>36{children}37</ThemeContext>38```3940## ref as a Prop4142### Removing forwardRef4344Components can now receive `ref` as a regular prop. `forwardRef` is no longer needed:4546```tsx47// Before (React 18)48import { forwardRef } from "react";4950const Input = forwardRef<TextInput, Props>((props, ref) => {51return <TextInput ref={ref} {...props} />;52});5354// After (React 19)55function Input({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {56return <TextInput ref={ref} {...props} />;57}58```5960### Migration Steps61621. Remove `forwardRef` wrapper632. Add `ref` to the props destructuring643. Update the type to include `ref?: React.Ref<T>`6566## Other React 19 Features6768- **Actions** — Functions that handle async transitions69- **useOptimistic** — Optimistic UI updates70- **useFormStatus** — Form submission state (web)71- **Document Metadata** — Native `<title>` and `<meta>` support (web)7273## Cleanup Checklist7475When upgrading to SDK 54:7677- [ ] Replace `useContext` with `use`78- [ ] Remove `.Provider` from Context components79- [ ] Remove `forwardRef` wrappers, use `ref` prop instead80