url
stringlengths
17
87
content
stringlengths
152
81.8k
https://react.dev
![logo by @sawaratsuki1004](/_next/image?url=%2Fimages%2Fuwu.png&w=640&q=75 "logo by @sawaratsuki1004") # React The library for web and native user interfaces [Learn React](https://react.dev/learn)[API Reference](https://react.dev/reference/react) ## Create user interfaces from components React lets you build user...
https://react.dev/community
[Community](https://react.dev/community) # React Community[Link for this heading]() React has a community of millions of developers. On this page we’ve listed some React-related communities that you can be a part of; see the other pages in this section for additional online and in-person learning materials. ## Code ...
https://react.dev/reference/react
[API Reference](https://react.dev/reference/react) # React Reference Overview[Link for this heading]() This section provides detailed reference documentation for working with React. For an introduction to React, please visit the [Learn](https://react.dev/learn) section. The React reference documentation is broken do...
https://react.dev/blog
[Blog](https://react.dev/blog) # React Blog[Link for this heading]() This blog is the official source for the updates from the React team. Anything important, including release notes or deprecation notices, will be posted here first. You can also follow the [@reactjs](https://twitter.com/reactjs) account on Twitter, ...
https://react.dev/versions
[React Docs](https://react.dev/) # React Versions[Link for this heading]() The React docs at [react.dev](https://react.dev) provide documentation for the latest version of React. We aim to keep the docs updated within major versions, and do not publish versions for each minor or patch version. When a new major is re...
https://react.dev/community/translations
[Community](https://react.dev/community) # Translations[Link for this heading]() React docs are translated by the global community into many languages all over the world. ## Source site[Link for Source site]() All translations are provided from the canonical source docs: - [English](https://react.dev/) — [Contribu...
https://react.dev/learn
[Learn React](https://react.dev/learn) # Quick Start[Link for this heading]() Welcome to the React documentation! This page will give you an introduction to 80% of the React concepts that you will use on a daily basis. ### You will learn - How to create and nest components - How to add markup and styles - How to di...
https://react.dev/learn/add-react-to-an-existing-project
[Learn React](https://react.dev/learn) [Installation](https://react.dev/learn/installation) # Add React to an Existing Project[Link for this heading]() If you want to add some interactivity to your existing project, you don’t have to rewrite it in React. Add React to your existing stack, and render interactive React...
https://react.dev/
![logo by @sawaratsuki1004](/_next/image?url=%2Fimages%2Fuwu.png&w=640&q=75 "logo by @sawaratsuki1004") # React The library for web and native user interfaces [Learn React](https://react.dev/learn)[API Reference](https://react.dev/reference/react) ## Create user interfaces from components React lets you build user...
https://react.dev/learn/start-a-new-react-project
[Learn React](https://react.dev/learn) [Installation](https://react.dev/learn/installation) # Start a New React Project[Link for this heading]() If you want to build a new app or a new website fully with React, we recommend picking one of the React-powered frameworks popular in the community. You can use React with...
https://react.dev/blog/2024/05/22/react-conf-2024-recap
[Blog](https://react.dev/blog) # React Conf 2024 Recap[Link for this heading]() May 22, 2024 by [Ricky Hanlon](https://twitter.com/rickhanlonii). * * * Last week we hosted React Conf 2024, a two-day conference in Henderson, Nevada where 700+ attendees gathered in-person to discuss the latest in UI engineering. This...
https://react.dev/blog/2024/10/21/react-compiler-beta-release
[Blog](https://react.dev/blog) # React Compiler Beta Release[Link for this heading]() October 21, 2024 by [Lauren Tan](https://twitter.com/potetotes). * * * The React team is excited to share new updates: 1. We’re publishing React Compiler Beta today, so that early adopters and library maintainers can try it and p...
https://react.dev/blog/2024/12/05/react-19
[Blog](https://react.dev/blog) # React v19[Link for this heading]() December 05, 2024 by [The React Team](https://react.dev/community/team) * * * ### Note ### React 19 is now stable\![Link for React 19 is now stable!]() Additions since this post was originally shared with the React 19 RC in April: - **Pre-warmin...
https://react.dev/learn/installation
[Learn React](https://react.dev/learn) # Installation[Link for this heading]() React has been designed from the start for gradual adoption. You can use as little or as much React as you need. Whether you want to get a taste of React, add some interactivity to an HTML page, or start a complex React-powered app, this s...
https://react.dev/learn/adding-interactivity
[Learn React](https://react.dev/learn) # Adding Interactivity[Link for this heading]() Some things on the screen update in response to user input. For example, clicking an image gallery switches the active image. In React, data that changes over time is called *state.* You can add state to any component, and update i...
https://react.dev/learn/describing-the-ui
[Learn React](https://react.dev/learn) # Describing the UI[Link for this heading]() React is a JavaScript library for rendering user interfaces (UI). UI is built from small units like buttons, text, and images. React lets you combine them into reusable, nestable *components.* From web sites to phone apps, everything ...
https://react.dev/learn/managing-state
[Learn React](https://react.dev/learn) # Managing State[Link for this heading]() Intermediate As your application grows, it helps to be more intentional about how your state is organized and how the data flows between your components. Redundant or duplicate state is a common source of bugs. In this chapter, you’ll l...
https://react.dev/blog/2024/12/05/react-19
[Blog](https://react.dev/blog) # React v19[Link for this heading]() December 05, 2024 by [The React Team](https://react.dev/community/team) * * * ### Note ### React 19 is now stable\![Link for React 19 is now stable!]() Additions since this post was originally shared with the React 19 RC in April: - **Pre-warmin...
https://react.dev/reference/react-dom
[API Reference](https://react.dev/reference/react) # React DOM APIs[Link for this heading]() The `react-dom` package contains methods that are only supported for the web applications (which run in the browser DOM environment). They are not supported for React Native. * * * ## APIs[Link for APIs]() These APIs can b...
https://react.dev/community/docs-contributors
[Community](https://react.dev/community) # Docs Contributors[Link for this heading]() React documentation is written and maintained by the [React team](https://react.dev/community/team) and [external contributors.](https://github.com/reactjs/react.dev/graphs/contributors) On this page, we’d like to thank a few people...
https://react.dev/community/acknowledgements
[Community](https://react.dev/community) # Acknowledgements[Link for this heading]() React was originally created by [Jordan Walke.](https://github.com/jordwalke) Today, React has a [dedicated full-time team working on it](https://react.dev/community/team), as well as over a thousand [open source contributors.](https...
https://react.dev/community/team
[Community](https://react.dev/community) # Meet the Team[Link for this heading]() React development is led by a dedicated team working full time at Meta. It also receives contributions from people all over the world. ## React Core[Link for React Core]() The React Core team members work full time on the core compone...
https://react.dev/learn/escape-hatches
[Learn React](https://react.dev/learn) # Escape Hatches[Link for this heading]() Advanced Some of your components may need to control and synchronize with systems outside of React. For example, you might need to focus an input using the browser API, play and pause a video player implemented without React, or connect...
https://react.dev/community/videos
[Community](https://react.dev/community) # React Videos[Link for this heading]() Videos dedicated to the discussion of React and the React ecosystem. ## React Conf 2021[Link for React Conf 2021]() ### React 18 Keynote[Link for React 18 Keynote]() In the keynote, we shared our vision for the future of React startin...
https://react.dev/community/meetups
[Community](https://react.dev/community) # React Meetups[Link for this heading]() Do you have a local React.js meetup? Add it here! (Please keep the list alphabetical) ## Albania[Link for Albania]() - [Tirana](https://www.meetup.com/React-User-Group-Albania/) ## Argentina[Link for Argentina]() - [Buenos Aires](ht...
https://react.dev/community/versioning-policy
[Community](https://react.dev/community) # Versioning Policy[Link for this heading]() All stable builds of React go through a high level of testing and follow semantic versioning (semver). React also offers unstable release channels to encourage early feedback on experimental features. This page describes what you ca...
https://react.dev/reference/react/hooks
[API Reference](https://react.dev/reference/react) # Built-in React Hooks[Link for this heading]() *Hooks* let you use different React features from your components. You can either use the built-in Hooks or combine them to build your own. This page lists all built-in Hooks in React. * * * ## State Hooks[Link for St...
https://react.dev/reference/react/useCallback
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useCallback[Link for this heading]() `useCallback` is a React Hook that lets you cache a function definition between re-renders. ``` const cachedFn = useCallback(fn, dependencies) ``` - [Reference]() - [`use...
https://react.dev/community/conferences
[Community](https://react.dev/community) # React Conferences[Link for this heading]() Do you know of a local React.js conference? Add it here! (Please keep the list chronological) ## Upcoming Conferences[Link for Upcoming Conferences]() ### React Day Berlin 2024[Link for React Day Berlin 2024]() December 13 & ...
https://react.dev/reference/react/useDebugValue
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useDebugValue[Link for this heading]() `useDebugValue` is a React Hook that lets you add a label to a custom Hook in [React DevTools.](https://react.dev/learn/react-developer-tools) ``` useDebugValue(value, format...
https://react.dev/reference/react/useDeferredValue
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useDeferredValue[Link for this heading]() `useDeferredValue` is a React Hook that lets you defer updating a part of the UI. ``` const deferredValue = useDeferredValue(value) ``` - [Reference]() - [`useDeferr...
https://react.dev/reference/react/useContext
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useContext[Link for this heading]() `useContext` is a React Hook that lets you read and subscribe to [context](https://react.dev/learn/passing-data-deeply-with-context) from your component. ``` const value = useCo...
https://react.dev/reference/react/useId
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useId[Link for this heading]() `useId` is a React Hook for generating unique IDs that can be passed to accessibility attributes. ``` const id = useId() ``` - [Reference]() - [`useId()`]() - [Usage]() - ...
https://react.dev/reference/react/useImperativeHandle
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useImperativeHandle[Link for this heading]() `useImperativeHandle` is a React Hook that lets you customize the handle exposed as a [ref.](https://react.dev/learn/manipulating-the-dom-with-refs) ``` useImperativeHa...
https://react.dev/reference/react/useActionState
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useActionState[Link for this heading]() `useActionState` is a Hook that allows you to update state based on the result of a form action. ``` const [state, formAction, isPending] = useActionState(fn, initialState, ...
https://react.dev/reference/react/useMemo
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useMemo[Link for this heading]() `useMemo` is a React Hook that lets you cache the result of a calculation between re-renders. ``` const cachedValue = useMemo(calculateValue, dependencies) ``` - [Reference]() ...
https://react.dev/reference/react/useLayoutEffect
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useLayoutEffect[Link for this heading]() ### Pitfall `useLayoutEffect` can hurt performance. Prefer [`useEffect`](https://react.dev/reference/react/useEffect) when possible. `useLayoutEffect` is a version of [`use...
https://react.dev/reference/react/useEffect
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useEffect[Link for this heading]() `useEffect` is a React Hook that lets you [synchronize a component with an external system.](https://react.dev/learn/synchronizing-with-effects) ``` useEffect(setup, dependencies...
https://react.dev/reference/react/useRef
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useRef[Link for this heading]() `useRef` is a React Hook that lets you reference a value that’s not needed for rendering. ``` const ref = useRef(initialValue) ``` - [Reference]() - [`useRef(initialValue)`]()...
https://react.dev/reference/react/useReducer
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useReducer[Link for this heading]() `useReducer` is a React Hook that lets you add a [reducer](https://react.dev/learn/extracting-state-logic-into-a-reducer) to your component. ``` const [state, dispatch] = useRed...
https://react.dev/reference/react/useState
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useState[Link for this heading]() `useState` is a React Hook that lets you add a [state variable](https://react.dev/learn/state-a-components-memory) to your component. ``` const [state, setState] = useState(initia...
https://react.dev/reference/react/Fragment
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react/components) # &lt;Fragment&gt; (&lt;&gt;...&lt;/&gt;)[Link for this heading]() `<Fragment>`, often used via `<>...</>` syntax, lets you group elements without a wrapper node. ``` <> <OneChild /> <AnotherChild />...
https://react.dev/reference/react/useSyncExternalStore
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useSyncExternalStore[Link for this heading]() `useSyncExternalStore` is a React Hook that lets you subscribe to an external store. ``` const snapshot = useSyncExternalStore(subscribe, getSnapshot, getServerSnapsho...
https://react.dev/reference/react/useInsertionEffect
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useInsertionEffect[Link for this heading]() ### Pitfall `useInsertionEffect` is for CSS-in-JS library authors. Unless you are working on a CSS-in-JS library and need a place to inject the styles, you probably want ...
https://react.dev/reference/react/StrictMode
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react/components) # &lt;StrictMode&gt;[Link for this heading]() `<StrictMode>` lets you find common bugs in your components early during development. ``` <StrictMode> <App /> </StrictMode> ``` - [Reference]() - [`...
https://react.dev/reference/react/Profiler
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react/components) # &lt;Profiler&gt;[Link for this heading]() `<Profiler>` lets you measure rendering performance of a React tree programmatically. ``` <Profiler id="App" onRender={onRender}> <App /> </Profiler> ``` - ...
https://react.dev/reference/react/useTransition
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useTransition[Link for this heading]() `useTransition` is a React Hook that lets you render a part of the UI in the background. ``` const [isPending, startTransition] = useTransition() ``` - [Reference]() - ...
https://react.dev/reference/react/apis
[API Reference](https://react.dev/reference/react) # Built-in React APIs[Link for this heading]() In addition to [Hooks](https://react.dev/reference/react) and [Components](https://react.dev/reference/react/components), the `react` package exports a few other APIs that are useful for defining components. This page li...
https://react.dev/reference/react/cache
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # cache - This feature is available in the latest Canary[Link for this heading]() ### React Server Components `cache` is only for use with [React Server Components](https://react.dev/blog/2023/03/22/react-labs-what-we-...
https://react.dev/reference/react/useOptimistic
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react/hooks) # useOptimistic[Link for this heading]() `useOptimistic` is a React Hook that lets you optimistically update the UI. ``` const [optimisticState, addOptimistic] = useOptimistic(state, updateFn); ``` - [Reference](...
https://react.dev/reference/react/Suspense
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react/components) # &lt;Suspense&gt;[Link for this heading]() `<Suspense>` lets you display a fallback until its children have finished loading. ``` <Suspense fallback={<Loading />}> <SomeComponent /> </Suspense> ``` -...
https://react.dev/reference/react/components
[API Reference](https://react.dev/reference/react) # Built-in React Components[Link for this heading]() React exposes a few built-in components that you can use in your JSX. * * * ## Built-in components[Link for Built-in components]() - [`<Fragment>`](https://react.dev/reference/react/Fragment), alternatively writ...
https://react.dev/reference/react/act
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # act[Link for this heading]() `act` is a test helper to apply pending React updates before making assertions. ``` await act(async actFn) ``` To prepare a component for assertions, wrap the code rendering it and perf...
https://react.dev/reference/react/createContext
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # createContext[Link for this heading]() `createContext` lets you create a [context](https://react.dev/learn/passing-data-deeply-with-context) that components can provide or read. ``` const SomeContext = createContext...
https://react.dev/reference/react/startTransition
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # startTransition[Link for this heading]() `startTransition` lets you render a part of the UI in the background. ``` startTransition(action) ``` - [Reference]() - [`startTransition(action)`]() - [Usage]() -...
https://react.dev/reference/react/lazy
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # lazy[Link for this heading]() `lazy` lets you defer loading component’s code until it is rendered for the first time. ``` const SomeComponent = lazy(load) ``` - [Reference]() - [`lazy(load)`]() - [`load` fun...
https://react.dev/reference/react/experimental_taintUniqueValue
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # experimental\_taintUniqueValue[Link for this heading]() ### Under Construction **This API is experimental and is not available in a stable version of React yet.** You can try it by upgrading React packages to the mo...
https://react.dev/reference/react/experimental_taintObjectReference
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # experimental\_taintObjectReference[Link for this heading]() ### Under Construction **This API is experimental and is not available in a stable version of React yet.** You can try it by upgrading React packages to th...
https://react.dev/reference/react/use
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # use[Link for this heading]() `use` is a React API that lets you read the value of a resource like a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) or [context](http...
https://react.dev/reference/react/memo
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react/apis) # memo[Link for this heading]() `memo` lets you skip re-rendering a component when its props are unchanged. ``` const MemoizedComponent = memo(SomeComponent, arePropsEqual?) ``` - [Reference]() - [`memo(Componen...
https://react.dev/reference/react-dom/hooks
[API Reference](https://react.dev/reference/react) # Built-in React DOM Hooks[Link for this heading]() The `react-dom` package contains Hooks that are only supported for web applications (which run in the browser DOM environment). These Hooks are not supported in non-browser environments like iOS, Android, or Windows...
https://react.dev/reference/react-dom/hooks/useFormStatus
[API Reference](https://react.dev/reference/react) [Hooks](https://react.dev/reference/react-dom/hooks) # useFormStatus[Link for this heading]() `useFormStatus` is a Hook that gives you status information of the last form submission. ``` const { pending, data, method, action } = useFormStatus(); ``` - [Reference]...
https://react.dev/reference/react-dom/components/form
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;form&gt;[Link for this heading]() The [built-in browser `<form>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) lets you create interactive controls for submitting infor...
https://react.dev/reference/react-dom/components
[API Reference](https://react.dev/reference/react) # React DOM Components[Link for this heading]() React supports all of the browser built-in [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML/Element) and [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG/Element) components. * * * ## Common components[L...
https://react.dev/reference/react-dom/components/option
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;option&gt;[Link for this heading]() The [built-in browser `<option>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option) lets you render an option inside a [`<select>`](htt...
https://react.dev/reference/react-dom/components/input
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;input&gt;[Link for this heading]() The [built-in browser `<input>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) lets you render different kinds of form inputs. ``` ...
https://react.dev/reference/react-dom/components/select
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;select&gt;[Link for this heading]() The [built-in browser `<select>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) lets you render a select box with options. ``` <s...
https://react.dev/reference/react-dom/components/textarea
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;textarea&gt;[Link for this heading]() The [built-in browser `<textarea>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) lets you render a multiline text input. ``` ...
https://react.dev/reference/react-dom/components/common
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # Common components (e.g. &lt;div&gt;)[Link for this heading]() All built-in browser components, such as [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div), support some common prop...
https://react.dev/reference/react-dom/components/link
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;link&gt;[Link for this heading]() The [built-in browser `<link>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) lets you use external resources such as stylesheets or an...
https://react.dev/reference/react-dom/components/progress
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;progress&gt;[Link for this heading]() The [built-in browser `<progress>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress) lets you render a progress indicator. ``` <...
https://react.dev/reference/react-dom/components/style
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;style&gt;[Link for this heading]() The [built-in browser `<style>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style) lets you add inline CSS stylesheets to your document. ...
https://react.dev/reference/react-dom/components/meta
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;meta&gt;[Link for this heading]() The [built-in browser `<meta>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) lets you add metadata to the document. ``` <meta name="...
https://react.dev/reference/react-dom/components/script
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;script&gt;[Link for this heading]() The [built-in browser `<script>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) lets you add a script to your document. ``` <scri...
https://react.dev/reference/react-dom/components/title
[API Reference](https://react.dev/reference/react) [Components](https://react.dev/reference/react-dom/components) # &lt;title&gt;[Link for this heading]() The [built-in browser `<title>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title) lets you specify the title of the document. ``` <tit...
https://react.dev/reference/react-dom/flushSync
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # flushSync[Link for this heading]() ### Pitfall Using `flushSync` is uncommon and can hurt the performance of your app. `flushSync` lets you force React to flush any updates inside the provided callback synchronously....
https://react.dev/reference/react-dom/preconnect
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # preconnect[Link for this heading]() `preconnect` lets you eagerly connect to a server that you expect to load resources from. ``` preconnect("https://example.com"); ``` - [Reference]() - [`preconnect(href)`]() ...
https://react.dev/reference/react-dom/prefetchDNS
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # prefetchDNS[Link for this heading]() `prefetchDNS` lets you eagerly look up the IP of a server that you expect to load resources from. ``` prefetchDNS("https://example.com"); ``` - [Reference]() - [`prefetchDNS...
https://react.dev/reference/react-dom/createPortal
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # createPortal[Link for this heading]() `createPortal` lets you render some children into a different part of the DOM. ``` <div> <SomeComponent /> {createPortal(children, domNode, key?)} </div> ``` - [Reference...
https://react.dev/reference/react-dom/preinit
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # preinit[Link for this heading]() ### Note [React-based frameworks](https://react.dev/learn/start-a-new-react-project) frequently handle resource loading for you, so you might not have to call this API yourself. Consul...
https://react.dev/reference/react-dom/preloadModule
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # preloadModule[Link for this heading]() ### Note [React-based frameworks](https://react.dev/learn/start-a-new-react-project) frequently handle resource loading for you, so you might not have to call this API yourself. ...
https://react.dev/reference/react-dom/preinitModule
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # preinitModule[Link for this heading]() ### Note [React-based frameworks](https://react.dev/learn/start-a-new-react-project) frequently handle resource loading for you, so you might not have to call this API yourself. ...
https://react.dev/reference/react-dom/preload
[API Reference](https://react.dev/reference/react) [APIs](https://react.dev/reference/react-dom) # preload[Link for this heading]() ### Note [React-based frameworks](https://react.dev/learn/start-a-new-react-project) frequently handle resource loading for you, so you might not have to call this API yourself. Consul...
https://react.dev/reference/react-dom/client
[API Reference](https://react.dev/reference/react) # Client React DOM APIs[Link for this heading]() The `react-dom/client` APIs let you render React components on the client (in the browser). These APIs are typically used at the top level of your app to initialize your React tree. A [framework](https://react.dev/lear...
https://react.dev/reference/react-dom/server
[API Reference](https://react.dev/reference/react) # Server React DOM APIs[Link for this heading]() The `react-dom/server` APIs let you server-side render React components to HTML. These APIs are only used on the server at the top level of your app to generate the initial HTML. A [framework](https://react.dev/learn/s...
https://react.dev/reference/react-dom/client/createRoot
[API Reference](https://react.dev/reference/react) [Client APIs](https://react.dev/reference/react-dom/client) # createRoot[Link for this heading]() `createRoot` lets you create a root to display React components inside a browser DOM node. ``` const root = createRoot(domNode, options?) ``` - [Reference]() - ...
https://react.dev/reference/react-dom/client/hydrateRoot
[API Reference](https://react.dev/reference/react) [Client APIs](https://react.dev/reference/react-dom/client) # hydrateRoot[Link for this heading]() `hydrateRoot` lets you display React components inside a browser DOM node whose HTML content was previously generated by [`react-dom/server`.](https://react.dev/refere...
https://react.dev/blog/2024/04/25/react-19-upgrade-guide
[Blog](https://react.dev/blog) # React 19 Upgrade Guide[Link for this heading]() April 25, 2024 by [Ricky Hanlon](https://twitter.com/rickhanlonii) * * * The improvements added to React 19 require some breaking changes, but we’ve worked to make the upgrade as smooth as possible, and we don’t expect the changes to i...
https://react.dev/reference/react-dom/server/renderToPipeableStream
[API Reference](https://react.dev/reference/react) [Server APIs](https://react.dev/reference/react-dom/server) # renderToPipeableStream[Link for this heading]() `renderToPipeableStream` renders a React tree to a pipeable [Node.js Stream.](https://nodejs.org/api/stream.html) ``` const { pipe, abort } = renderToPipe...
https://react.dev/blog/2023/05/03/react-canaries
[Blog](https://react.dev/blog) # React Canaries: Enabling Incremental Feature Rollout Outside Meta[Link for this heading]() May 3, 2023 by [Dan Abramov](https://twitter.com/dan_abramov), [Sophie Alpert](https://twitter.com/sophiebits), [Rick Hanlon](https://twitter.com/rickhanlonii), [Sebastian Markbåge](https://twit...
https://react.dev/reference/rsc/use-client
[API Reference](https://react.dev/reference/react) [Directives](https://react.dev/reference/rsc/directives) # 'use client'[Link for this heading]() ### React Server Components `'use client'` is for use with [React Server Components](https://react.dev/learn/start-a-new-react-project). `'use client'` lets you mark w...
https://react.dev/reference/react-dom/server/renderToStaticMarkup
[API Reference](https://react.dev/reference/react) [Server APIs](https://react.dev/reference/react-dom/server) # renderToStaticMarkup[Link for this heading]() `renderToStaticMarkup` renders a non-interactive React tree to an HTML string. ``` const html = renderToStaticMarkup(reactNode, options?) ``` - [Reference]...
https://react.dev/reference/react-dom/server/renderToString
[API Reference](https://react.dev/reference/react) [Server APIs](https://react.dev/reference/react-dom/server) # renderToString[Link for this heading]() ### Pitfall `renderToString` does not support streaming or waiting for data. [See the alternatives.]() `renderToString` renders a React tree to an HTML string. `...
https://react.dev/reference/react-dom/server/renderToReadableStream
[API Reference](https://react.dev/reference/react) [Server APIs](https://react.dev/reference/react-dom/server) # renderToReadableStream[Link for this heading]() `renderToReadableStream` renders a React tree to a [Readable Web Stream.](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) ``` const strea...
https://react.dev/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023
[Blog](https://react.dev/blog) # React Labs: What We've Been Working On – March 2023[Link for this heading]() March 22, 2023 by [Joseph Savona](https://twitter.com/en_JS), [Josh Story](https://twitter.com/joshcstory), [Lauren Tan](https://twitter.com/potetotes), [Mengdi Chen](https://twitter.com/mengdi_en), [Samuel S...
https://react.dev/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022
[Blog](https://react.dev/blog) # React Labs: What We've Been Working On – June 2022[Link for this heading]() June 15, 2022 by [Andrew Clark](https://twitter.com/acdlite), [Dan Abramov](https://twitter.com/dan_abramov), [Jan Kassens](https://twitter.com/kassens), [Joseph Savona](https://twitter.com/en_JS), [Josh Story...
https://react.dev/blog/2023/03/16/introducing-react-dev
[Blog](https://react.dev/blog) # Introducing react.dev[Link for this heading]() March 16, 2023 by [Dan Abramov](https://twitter.com/dan_abramov) and [Rachel Nabors](https://twitter.com/rachelnabors) * * * Today we are thrilled to launch [react.dev](https://react.dev), the new home for React and its documentation. I...
https://react.dev/blog/2021/12/17/react-conf-2021-recap
[Blog](https://react.dev/blog) # React Conf 2021 Recap[Link for this heading]() December 17, 2021 by [Jesslyn Tannady](https://twitter.com/jtannady) and [Rick Hanlon](https://twitter.com/rickhanlonii) * * * Last week we hosted our 6th React Conf. In previous years, we’ve used the React Conf stage to deliver industr...
https://react.dev/reference/rsc/directives
[API Reference](https://react.dev/reference/react) # Directives[Link for this heading]() ### React Server Components Directives are for use in [React Server Components](https://react.dev/learn/start-a-new-react-project). Directives provide instructions to [bundlers compatible with React Server Components](https://r...
https://react.dev/reference/react/legacy
[API Reference](https://react.dev/reference/react) # Legacy React APIs[Link for this heading]() These APIs are exported from the `react` package, but they are not recommended for use in newly written code. See the linked individual API pages for the suggested alternatives. * * * ## Legacy APIs[Link for Legacy APIs]...