-
-
Notifications
You must be signed in to change notification settings - Fork 28
React
LeoTM edited this page Oct 22, 2025
·
88 revisions
https://github.com/leotm/react-native-template-new-architecture/wiki/Codemods
- use{State,Effect,Context,Reducer,Callback,Memo,Ref,ImperativeHandle,LayoutEffect}
- Fragment, Suspense, StrictMode, Profiler
- ErrorBoundary(react-error-boundary), Portal, lazy
- nb: try/catch: promise, !res.ok: http (e.g. 404)
-
StackFiber Reconciler
- Progressive updates
Adopting Concurrent Mode (Experimental)-
Introducing Concurrent Mode (Experimental)_ Suspense for Data Fetching (Experimental)Concurrent UI Patterns (Experimental)Concurrent Mode API Reference (Experimental)
- Concurrent rendering (default)
-
Suspensewait for children<ErrorBoundary fallback={<p>RIP</p>}> <Suspense fallback={<Loading />}> <Component /> </...> </...>
-
startTransition,useTransition(background/non-blocking update, old ui still visiable/interactive)const [isPending, startTransition] = useTransition()<button disabled={pending} onClick={() => { startTransition(async () => { await fetchData() }) }} >- wrap w ErrorBoundary>Suspense>Component as usual
useDeferredValue-
useSyncExternalStoreconst todos = useSyncExternalStore(todosStore.subscribe, todosStore.getSnapshot)
useInsertionEffectuseId (SSR)
-
- Auto batching
React Native New Architecture (RN 0.76) β¨
-
useEffect+useStateuse(fetchData),useContextuse(Context)- wrap w ErrorBoundary>Suspense>Component as usual
- Actions: useActionState, useFormStatus, useOptimistic
- Server Components
- background Activity
{isShowingSidebar && (<Sidebar />)}<Activity mode={isShowingSidebar ? "visible" : "hidden"}> <Sidebar /> </Activity>
-
React ForgetReact Compiler (discussions)- auto useCallback/useMemo (+inferred dep arrays)
- can still
"use no memo"
- useEffectEvent
- ViewTransition
- DevTools: TS support, perf (re-render) insights, perf tracks (scheduler), debug react 19 hooks, Server Components, Suspense, Activity, cleaner errors
- eslint-plugin-react-hooks upg