Show Menu
Cheatography

React 19 Cheat Sheet Cheat Sheet (DRAFT) by

Based on https://react.dev/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024

This is a draft cheat sheet. It is a work in progress and is not finished yet.

React Compiler - memo

useMemo
auto
useCal­lback
auto
memo
auto
You no longer need to do these manually

React Compiler - lazy

React.lazy
Suspense
useMemo
Suspense
useCal­lback
Suspense
useContext
Suspense
by React Suspense Compiler (RSC)

use()

use(co­ntext)
instead of useCon­text()

use()

use(co­ntext)
instead of useCon­text() -- useContext must be called at the top level of the component, and use can be called inside condit­ional statements such as if and loops such as for
use(pr­omise)
'use client';  import { use } from 'react';  export function Message({ messag­ePr­omise }) {   const messag­eCo­ntent = use(me­ssa­geP­rom­ise);   return <p>Here is the message: {messa­geC­ont­ent­}</­p>; }
return value of the context