An Owner Stack is a string representing the components that are directly responsible for rendering a particular component. You can log Owner Stacks when debugging or use Owner Stacks to enhance error overlays or other development tools. Owner Stacks are only available in development builds. Component Stacks in production are unchanged.
useId
to use valid CSS selectors, changing format from :r123:
to «r123»
. #32001href
attribute is an empty string #31783getHoistableRoot()
didn’t work properly when the container was a Document #32321<!-- -->
) as a DOM container. #32250<script>
and <template>
tags to be nested within <select>
tags. #31837exports
field to package.json
for use-sync-external-store
to support various entrypoints. #25231unstable_prerender
, a new experimental API for prerendering React Server Components on the server #31724registerServerReference
in client builds to handle server references in different environments. #32534Below is a list of all new features, APIs, deprecations, and breaking changes. Read React 19 release post and React 19 upgrade guide for more information.
New Features ReactNote: To help make the upgrade to React 19 easier, we’ve published a react@18.3 release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19. We recommend upgrading to React 18.3.1 first to help identify any issues before upgrading to React 19.
startTransition
can now accept async functions. Functions passed to startTransition
are called “Actions”. A given Transition can include one or more Actions which update state in the background and update the UI with one commit. In addition to updating state, Actions can now perform side effects including async requests, and the Action will wait for the work to finish before finishing the Transition. This feature allows Transitions to include side effects like fetch()
in the pending state, and provides support for error handling, and optimistic updates.useActionState
: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a form action
prop to support progressive enhancement in forms.useOptimistic
: is a new hook to update state while a Transition is in progress. It returns the state, and a set function that can be called inside a transition to “optimistically” update the state to expected final value immediately while the Transition completes in the background. When the transition finishes, the state is updated to the new value.use
: is a new API that allows reading resources in render. In React 19, use
accepts a promise or Context. If provided a promise, use
will suspend until a value is resolved. use
can only be used in render but can be called conditionally.ref
as a prop: Refs can now be used as props, removing the need for forwardRef
.<form> action
prop: Form Actions allow you to manage forms automatically and integrate with useFormStatus
. When a <form> action
succeeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the new requestFormReset
API.<button> and <input> formAction
prop: Actions can be passed to the formAction
prop to configure form submission behavior. This allows using different Actions depending on the input.useFormStatus
: is a new hook that provides the status of the parent <form> action
, as if the form was a Context provider. The hook returns the values: pending
, data
, method
, and action
.<head>
section of the document.<head>
on the client before revealing the content of a Suspense boundary that depends on that stylesheet.preinit
, preload
, prefetchDNS
, and preconnect
APIs to optimize initial page loads by moving discovery of additional resources like fonts out of stylesheet loading. They can also be used to prefetch resources used by an anticipated navigation.prerender
and prerenderToNodeStream
APIs for static site generation. They are designed to work with streaming environments like Node.js Streams and Web Streams. Unlike renderToString
, they wait for data to load for HTML generation.element.ref
access: React 19 supports ref as a prop, so we’re deprecating element.ref
in favor of element.props.ref
. Accessing will result in a warning.react-test-renderer
: In React 19, react-test-renderer logs a deprecation warning and has switched to concurrent rendering for web usage. We recommend migrating your tests to @testinglibrary.com/docs/react-testing-library/intro/) or @testingesting-library.com/docs/react-native-testing-library/intro)React 19 brings in a number of breaking changes, including the removals of long-deprecated APIs. We recommend first upgrading to 18.3.1
, where we've added additional deprecation warnings. Check out the upgrade guide for more details and guidance on codemodding.
onUncaughtError
and onCaughtError
methods to createRoot
and hydrateRoot
to customize this error handling.propTypes
: Using propTypes
will now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.defaultProps
for functions: ES6 default parameters can be used in place. Class components continue to support defaultProps
since there is no ES6 alternative.contextTypes
and getChildContext
: Legacy Context for class components has been removed in favor of the contextType
API.React.createFactory
: Now that JSX is broadly supported, all createFactory
usage can be migrated to JSX components.react-test-renderer/shallow
: This has been a re-export of react-shallow-renderer since React 18. If needed, you can continue to use the third-party package directly. We recommend using @testinglibrary.com/docs/react-testing-library/intro/) or @testingesting-library.com/docs/react-native-testing-library/intro) instead.react-dom/test-utils
: We’ve moved act
from react-dom/test-utils
to react. All other utilities have been removed.ReactDOM
.render
, ReactDOM
.hydrate
: These have been removed in favor of the concurrent equivalents: ReactDOM
.createRoot
and ReactDOM.hydrateRoot
.unmountComponentAtNode
: Removed in favor of root.unmount()
.ReactDOM
.findDOMNode
: You can replace ReactDOM
.findDOMNode
with DOM Refs.<Context>
as a provider: You can now render <Context>
as a provider instead of <Context.Provider>
.useDeferredValue
initial value argument: When provided, useDeferredValue
will return the initial value for the initial render of a component, then schedule a re-render in the background with the deferredValue
returned.useMemo
and useCallback
will now reuse the memoized results from the first render, during the second render. Additionally, StrictMode will now double-invoke ref callback functions on initial mount.The most common changes can be codemodded with npx types-react-codemod@latest preset-19 ./path-to-your-react-ts-files
.
ReactChild
(replacement: React.ReactElement | number | string)
ReactFragment
(replacement: Iterable<React.ReactNode>
)ReactNodeArray
(replacement: ReadonlyArray<React.ReactNode>
)ReactText
(replacement:...This release only contains eslint-plugin-react-hooks
. Notably, new violations and support for ESLint v9 were added.
eslint-plugin-react-hooks
_Button
or _component
are no longer valid. (@kassens) in #25162function _Component() { useState() ^^^^^^^^ A React Hook "useState" is called in function "_Component" which is neither a Component nor a custom React Hook function. }
_Component
should be renamed to Component
.useActionState
stable. (@eps1lon in #29665)as
expression in callback. (@StyleShit in #28202)as
expressions in deps array. (@StyleShit in #28189)React.use()
the same as use()
. (@kassens in #27769)use()
lint to non-experimental. (@kassens in #27768)as
expressions. (@cpojer in #27590)useEffect(fn, undefined)
. (@kassens in #27525)useEvent
to useEffectEvent
. (@sebmarkbage in #25881)useEvent
functions in dependency lists. (@poteto in #25512)useEvent
references instead. (@poteto in #25319)RulesOfHooks
with useEvent
rules. (@poteto in #25285)This release is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19.
Read the React 19 Upgrade Guide for more info.
Reactthis.refs
to support string ref codemod 909071findDOMNode
outside StrictMode c3b283test-utils
methods d4ea75defaultProps
for function components #25699key
#25697act
from test-utils
d4ea75unmountComponentAtNode
8a015brenderToStaticNodeStream
#28874onRecoverableError
. (@gnoff in #24591)document
causing a blank page on mismatch. (@gnoff in #24523)setState
in Safari when adding an iframe. (@gaearon in #24459)<title>
elements to match the browser constraints. (@gnoff in #24679)highWaterMark
to 0
. (@jplhomer in #24641)react-dom/client
when using UMD bundle. (@alireza-molaee in #24274)suppressHydrationWarning
to work in production too. (@gaearon in #24271)componentWillUnmount
firing twice inside of Suspense. (@acdlite in #24308)useDeferredValue
causing an infinite loop when passed an unmemoized value. (@acdlite in #24247)setState
loop in useEffect
. (@gaearon in #24298)setState
in useInsertionEffect
. (@gaearon in #24295)bootstrapScriptContent
contents. (@gnoff in #24385)renderToPipeableStream
. (@gnoff in #24291)Below is a list of all new features, APIs, deprecations, and breaking changes.
Read React 18 release post and React 18 upgrade guide for more information.
useId
is a new hook for generating unique IDs on both the client and server, while avoiding hydration mismatches. It is primarily useful for component libraries integrating with accessibility APIs that require unique IDs. This solves an issue that already exists in React 17 and below, but it’s even more important in React 18 because of how the new streaming server renderer delivers HTML out-of-order.startTransition
and useTransition
let you mark some state updates as not urgent. Other state updates are considered urgent by default. React will allow urgent state updates (for example, updating a text input) to interrupt non-urgent state updates (for example, rendering a list of search results).useDeferredValue
lets you defer re-rendering a non-urgent part of the tree. It is similar to debouncing, but has a few advantages compared to it. There is no fixed time delay, so React will attempt the deferred render right after the first render is reflected on the screen. The deferred render is interruptible and doesn't block user input.useSyncExternalStore
is a new hook that allows external stores to support concurrent reads by forcing updates to the store to be synchronous. It removes the need for useEffect
when implementing subscriptions to external data sources, and is recommended for any library that integrates with state external to React.useInsertionEffect
is a new hook that allows CSS-in-JS libraries to address performance issues of injecting styles in render. Unless you’ve already built a CSS-in-JS library we don’t expect you to ever use this. This hook will run after the DOM is mutated, but before layout effects read the new layout. This solves an issue that already exists in React 17 and below, but is even more important in React 18 because React yields to the browser during concurrent rendering, giving it a chance to recalculate layout.These new APIs are now exported from react-dom/client
:
createRoot
: New method to create a root to render
or unmount
. Use it instead of ReactDOM.render
. New features in React 18 don't work without it.hydrateRoot
: New method to hydrate a server rendered application. Use it instead of ReactDOM.hydrate
in conjunction with the new React DOM Server APIs. New features in React 18 don't work without it.Both createRoot
and hydrateRoot
accept a new option called onRecoverableError
in case you want to be notified when React recovers from errors during rendering or hydration for logging. By default, React will use reportError
, or console.error
in the older browsers.
These new APIs are now exported from react-dom/server
and have full support for streaming Suspense on the server:
renderToPipeableStream
: for streaming in Node environments.renderToReadableStream
: for modern edge runtime environments, such as Deno and Cloudflare workers.The existing renderToString
method keeps working but is discouraged.
react-dom
: ReactDOM.render
has been deprecated. Using it will warn and run your app in React 17 mode.react-dom
: ReactDOM.hydrate
has been deprecated. Using it will warn and run your app in React 17 mode.react-dom
: ReactDOM.unmountComponentAtNode
has been deprecated.react-dom
: ReactDOM.renderSubtreeIntoContainer
has been deprecated.react-dom/server
: ReactDOMServer.renderToNodeStream
has been deprecated.flushSync
.<Suspense>
boundary in the tree. This ensures the hydrated tree is consistent and avoids potential privacy and security holes that can be caused by hydration mismatches.Promise
, Symbol
, and Object.assign
. If you support older browsers and devices such as Internet Explorer which do not provide modern browser features natively or have non-compliant implementations, consider including a global polyfill in your bundled application.scheduler/tracing
APIundefined
: React no longer throws if you return undefined
from a component. This makes the allowed component return values consistent with values that are allowed in the middle of a component tree. We suggest to use a linter to prevent mistakes like forgetting a return
statement before JSX.act
warnings are now opt-in: If you're running end-to-end tests, the act
warnings are unnecessary. We've introduced an opt-in mechanism so you can enable them only for unit tests where they are useful and beneficial.setState
on unmounted components: Previously, React warned about memory leaks when you call setState
on an unmounted component. This warning was added for subscriptions, but people primarily run into it in scenarios where setting state is fine, and workarounds make the code worse. We've removed this warning.renderToString
: Will no longer error when suspending on the server. Instead, it will emit the fallback HTML for the closest <Suspense>
boundary and then retry rendering the same content on the client. It is still recommended that you switch to a streaming API like renderToPipeableStream
or renderToReadableStream
instead.renderToStaticMarkup
: Will no longer error when suspending on the server. Instead, it will emit the fallback HTML for the closest <Suspense>
boundary and retry rendering on the client.useTransition
and useDeferredValue
to separate urgent updates from transitions. (#10426, #10715, #15593, #15272, #15578, #15769, #17058, #18796, #19121, #19703, #19719, #19724, #20672, #20976 by [@acdlite](https://git...RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4