react-is breaking changes
npm116 curated breaking changes across major versions of react-is. Use this as a migration checklist before bumping dependencies.
- 18.3.1 \u2192 19.0.0removed
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](https://19.react.dev/blog/2024/04/25/react-19-upgrade-guide) for more details and guidance on codemodding.
- 17.0.2 \u2192 18.0.0api
`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.
- 17.0.2 \u2192 18.0.0api
`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.
- 17.0.2 \u2192 18.0.0behavior
`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).
- 17.0.2 \u2192 18.0.0behavior
**Consistent useEffect timing**: React now always synchronously flushes effect functions if the update was triggered during a discrete user input event such as a click or a keydown event. Previously, the behavior wasn't always predictable or consistent.
- 17.0.2 \u2192 18.0.0breaking
`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.
- 17.0.2 \u2192 18.0.0breaking
`renderToPipeableStream`: for streaming in Node environments.
- 17.0.2 \u2192 18.0.0breaking
`renderToReadableStream`: for modern edge runtime environments, such as Deno and Cloudflare workers.
- 17.0.2 \u2192 18.0.0breaking
`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.
- 17.0.2 \u2192 18.0.0breaking
**In tests, `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](https://github.com/reactwg/react-18/discussions/102) mechanism so you can enable them only for unit tests where they are useful and beneficial.
- 17.0.2 \u2192 18.0.0breaking
**Components can now render `undefined`:** 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.
- 17.0.2 \u2192 18.0.0breaking
**Automatic batching:** This release introduces a performance improvement that changes to the way React batches updates to do more batching automatically. See [Automatic batching for fewer renders in React 18](https://github.com/reactwg/react-18/discussions/21) for more info. In the rare case that you need to opt out, wrap the state update in `flushSync`.
- 17.0.2 \u2192 18.0.0breaking
**New JS Environment Requirements**: React now depends on modern browsers features including `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.
- 17.0.2 \u2192 18.0.0breaking
**Suspense trees are always consistent:** If a component suspends before it's fully added to the tree, React will not add it to the tree in an incomplete state or fire its effects. Instead, React will throw away the new tree completely, wait for the asynchronous operation to finish, and then retry rendering again from scratch. React will render the retry attempt concurrently, and without blocking the browser.
- 17.0.2 \u2192 18.0.0breaking
**Layout Effects with Suspense**: When a tree re-suspends and reverts to a fallback, React will now clean up layout effects, and then re-create them when the content inside the boundary is shown again. This fixes an issue which prevented component libraries from correctly measuring layout when used with Suspense.
- 17.0.2 \u2192 18.0.0breaking
`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.
- 17.0.2 \u2192 18.0.0deprecated
`react-dom`: `ReactDOM.renderSubtreeIntoContainer` has been deprecated.
- 17.0.2 \u2192 18.0.0deprecated
`react-dom`: `ReactDOM.render` has been deprecated. Using it will warn and run your app in React 17 mode.
- 17.0.2 \u2192 18.0.0deprecated
`react-dom`: `ReactDOM.hydrate` has been deprecated. Using it will warn and run your app in React 17 mode.
- 17.0.2 \u2192 18.0.0deprecated
`react-dom`: `ReactDOM.unmountComponentAtNode` has been deprecated.
- 17.0.2 \u2192 18.0.0deprecated
`react-dom/server`: `ReactDOMServer.renderToNodeStream` has been deprecated.
- 17.0.2 \u2192 18.0.0removed
**Stricter hydration errors**: Hydration mismatches due to missing or extra text content are now treated like errors instead of warnings. React will no longer attempt to "patch up" individual nodes by inserting or deleting a node on the client in an attempt to match the server markup, and will revert to client rendering up to the closest `<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.
- 17.0.2 \u2192 18.0.0removed
Remove unstable `scheduler/tracing` API
- 17.0.2 \u2192 18.0.0removed
**Stricter Strict Mode**: In the future, React will provide a feature that lets components preserve state between unmounts. To prepare for it, React 18 introduces a new development-only check to Strict Mode. React will automatically unmount and remount every component, whenever a component mounts for the first time, restoring the previous state on the second mount. If this breaks your app, consider removing Strict Mode until you can fix the components to be resilient to remounting with existing state.
- 17.0.2 \u2192 18.0.0removed
`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.
- 17.0.2 \u2192 18.0.0removed
**No warning about `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](https://github.com/facebook/react/pull/22114) this warning.
- 15.7.0 \u2192 16.0.0api
`setState` callback (second argument) now fires immediately after `componentDidMount` / `componentDidUpdate` instead of after all components have rendered.
- 15.7.0 \u2192 16.0.0api
To work around this, you can either use [the new portal API](https://github.com/facebook/react/issues/10309#issuecomment-318433235) or [refs](https://github.com/facebook/react/issues/10309#issuecomment-318434635).
- 15.7.0 \u2192 16.0.0api
`ReactDOM.unstable_batchedUpdates` now only takes one extra argument after the callback.
- 15.7.0 \u2192 16.0.0api
Hydrating a server rendered container now has an explicit API. Use `ReactDOM.hydrate` instead of `ReactDOM.render` if you're reviving server rendered HTML. Keep using `ReactDOM.render` if you're just doing client-side rendering.
- 15.7.0 \u2192 16.0.0behavior
Minor changes to `setState` behavior:
- 15.7.0 \u2192 16.0.0behavior
There are several changes to the behavior of scheduling and lifecycle methods:
- 15.7.0 \u2192 16.0.0behavior
Errors in the render and lifecycle methods now unmount the component tree by default. To prevent this, add [error boundaries](https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html) to the appropriate places in the UI.
- 15.7.0 \u2192 16.0.0breaking
When "unknown" props are passed to DOM components, for valid values, React will now render them in the DOM. [See this post for more details.](https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html) ([@nhunzaker](https://github.com/nhunzaker) in [#10385](https://github.com/facebook/react/pull/10385), [10564](https://github.com/facebook/react/pull/10564), [#10495](https://github.com/facebook/react/pull/10495) and others)
- 15.7.0 \u2192 16.0.0breaking
Previously, changing the `ref` to a component would always detach the ref before that component's render is called. Now, we change the `ref` later, when applying the changes to the DOM.
- 15.7.0 \u2192 16.0.0breaking
Calling `setState` directly in render always causes an update. This was not previously the case. Regardless, you should not be calling `setState` from render.
- 15.7.0 \u2192 16.0.0breaking
When replacing `<A />` with `<B />`, `B.componentWillMount` now always happens before `A.componentWillUnmount`. Previously, `A.componentWillUnmount` could fire first in some cases.
- 15.7.0 \u2192 16.0.0breaking
It is not safe to re-render into a container that was modified by something other than React. This worked previously in some cases but was never supported. We now emit a warning in this case. Instead you should clean up your component trees using `ReactDOM.unmountComponentAtNode`. [See this example.](https://github.com/facebook/react/issues/10294#issuecomment-318820987)
- 15.7.0 \u2192 16.0.0breaking
`componentDidUpdate` lifecycle no longer receives `prevContext` param. ([@bvaughn](https://github.com/bvaughn) in [#8631](https://github.com/facebook/react/pull/8631))
- 15.7.0 \u2192 16.0.0breaking
Non-unique keys may now cause children to be duplicated and/or omitted. Using non-unique keys is not (and has never been) supported, but previously it was a hard error.
- 15.7.0 \u2192 16.0.0breaking
Shallow renderer no longer calls `componentDidUpdate()` because DOM refs are not available. This also makes it consistent with `componentDidMount()` (which does not get called in previous versions either).
- 15.7.0 \u2192 16.0.0breaking
Shallow renderer does not implement `unstable_batchedUpdates()` anymore.
- 15.7.0 \u2192 16.0.0breaking
Calling `setState` with null no longer triggers an update. This allows you to decide in an updater function if you want to re-render.
- 15.7.0 \u2192 16.0.0breaking
The names and paths to the single-file browser builds have changed to emphasize the difference between development and production builds. For example:
- 15.7.0 \u2192 16.0.0breaking
`react/dist/react.js` → `react/umd/react.development.js`
- 15.7.0 \u2192 16.0.0breaking
`react/dist/react.min.js` → `react/umd/react.production.min.js`
- 15.7.0 \u2192 16.0.0breaking
`react-dom/dist/react-dom.js` → `react-dom/umd/react-dom.development.js`
- 15.7.0 \u2192 16.0.0breaking
`react-dom/dist/react-dom.min.js` → `react-dom/umd/react-dom.production.min.js`
- 15.7.0 \u2192 16.0.0breaking
The server renderer has been completely rewritten, with some improvements:
- 15.7.0 \u2192 16.0.0breaking
Server rendering does not use markup validation anymore, and instead tries its best to attach to existing DOM, warning about inconsistencies. It also doesn't use comments for empty components and data-reactid attributes on each node anymore.
- 15.7.0 \u2192 16.0.0breaking
`ReactDOM.render()` and `ReactDOM.unstable_renderIntoContainer()` now return `null` if called from inside a lifecycle method.
- 15.6.1 \u2192 15.6.2api
Prevent event handlers from receiving extra argument in development. ([@aweary](https://github.com/aweary) in [#10115](https://github.com/facebook/react/pull/8363))
- 15.6.1 \u2192 15.6.2behavior
Fix cases where `onChange` would not fire with `defaultChecked` on radio inputs. ([@jquense](https://github.com/jquense) in [#10156](https://github.com/facebook/react/pull/10156))
- 15.6.1 \u2192 15.6.2breaking
Add support for `controlList` attribute to allowed DOM properties ([@nhunzaker](https://github.com/nhunzaker) in [#9940](https://github.com/facebook/react/pull/9940))
- 15.6.1 \u2192 15.6.2breaking
Switch from BSD + Patents to MIT license
- 15.6.1 \u2192 15.6.2breaking
Fix a bug where modifying `document.documentMode` would trigger IE detection in other browsers, breaking change events. ([@aweary](https://github.com/aweary) in [#10032](https://github.com/facebook/react/pull/10032))
- 15.6.1 \u2192 15.6.2breaking
CSS Columns are treated as unitless numbers. ([@aweary](https://github.com/aweary) in [#10115](https://github.com/facebook/react/pull/10115))
- 15.6.1 \u2192 15.6.2breaking
Fix bug in QtWebKit when wrapping synthetic events in proxies. ([@walrusfruitcake](https://github.com/walrusfruitcake) in [#10115](https://github.com/facebook/react/pull/10011))
- 15.6.1 \u2192 15.6.2breaking
Fix a bug where creating an element with a ref in a constructor did not throw an error in development. ([@iansu](https://github.com/iansu) in [#10025](https://github.com/facebook/react/pull/10025))
- 0.14.10 \u2192 15.0.0behavior
**`React.cloneElement()` now resolves `defaultProps`.** We fixed a bug in `React.cloneElement()` that some components may rely on. If some of the `props` received by `cloneElement()` are `undefined`, it used to return an element with `undefined` values for those props. We’re changing it to be consistent with `createElement()`. Now any `undefined` props passed to `cloneElement()` are resolved to the corresponding component’s `defaultProps`. ([@truongduy134](https://github.com/truongduy134) in [#5997](https://github.com/facebook/react/pull/5997))
- 0.14.10 \u2192 15.0.0breaking
**No more extra `<span>`s.**
- 0.14.10 \u2192 15.0.0breaking
**`ReactPerf.getLastMeasurements()` is opaque.** This change won’t affect applications but may break some third-party tools. We are [revamping `ReactPerf` implementation](https://github.com/facebook/react/pull/6046) and plan to release it during the 15.x cycle. The internal performance measurement format is subject to change so, for the time being, we consider the return value of `ReactPerf.getLastMeasurements()` an opaque data structure that should not be relied upon. ([@gaearon](https://github.com/gaearon) in [#6286](https://github.com/facebook/react/pull/6286))
- 0.8.0 \u2192 0.9.0api
The lifecycle methods `componentDidMount` and `componentDidUpdate` no longer receive the root node as a parameter; use `this.getDOMNode()` instead
- 0.8.0 \u2192 0.9.0behavior
Whenever a prop is equal to `undefined`, the default value returned by `getDefaultProps` will now be used instead
- 0.8.0 \u2192 0.9.0breaking
On `input`, `select`, and `textarea` elements, `.getValue()` is no longer supported; use `.getDOMNode().value` instead
- 0.8.0 \u2192 0.9.0breaking
Full-page rendering (that is, rendering the `<html>` tag using React) is now supported only when starting with server-rendered markup
- 0.8.0 \u2192 0.9.0breaking
`this.context` on components is now reserved for internal use by React
- 0.8.0 \u2192 0.9.0breaking
`React.renderComponentToString` is now synchronous and returns the generated HTML string
- 0.8.0 \u2192 0.9.0breaking
When prop types validation fails, a warning is logged instead of an error thrown (with the production build of React, type checks are now skipped for performance)
- 0.8.0 \u2192 0.9.0breaking
On mouse wheel events, `deltaY` is no longer negated
- 0.8.0 \u2192 0.9.0removed
`React.unmountAndReleaseReactRootNode` was previously deprecated and has now been removed
- 0.4.1 \u2192 0.5.0api
Support for additional DOM properties (`charSet`, `content`, `form`, `httpEquiv`, `rowSpan`, `autoCapitalize`).
- 0.4.1 \u2192 0.5.0api
Support for [Composition events](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent).
- 0.4.1 \u2192 0.5.0behavior
Support for using `getInitialState` and `getDefaultProps` in mixins.
- 0.4.1 \u2192 0.5.0breaking
Support for additional SVG properties (`rx`, `ry`).
- 0.4.1 \u2192 0.5.0breaking
Memory usage improvements - reduced allocations in core which will help with GC pauses
- 0.4.1 \u2192 0.5.0breaking
Performance improvements - in addition to speeding things up, we made some tweaks to stay out of slow path code in V8 and Nitro.
- 0.4.1 \u2192 0.5.0breaking
Standardized prop -> DOM attribute process. This previously resulting in additional type checking and overhead as well as confusing cases for users. Now we will always convert your value to a string before inserting it into the DOM.
- 0.4.1 \u2192 0.5.0breaking
Support for Selection events.
- 0.4.1 \u2192 0.5.0breaking
Support mounting into iframes.
- 0.4.1 \u2192 0.5.0breaking
Bug fixes for controlled form components.
- 0.4.1 \u2192 0.5.0breaking
Bug fixes for SVG element creation.
- 0.4.1 \u2192 0.5.0breaking
Added `React.version`.
- 0.4.1 \u2192 0.5.0breaking
Added `React.isValidClass` - Used to determine if a value is a valid component constructor.
- 0.4.1 \u2192 0.5.0breaking
Began laying down work for refined performance analysis.
- 0.4.1 \u2192 0.5.0breaking
Better support for server-side rendering - [react-page](https://github.com/facebook/react-page) has helped improve the stability for server-side rendering.
- 0.4.1 \u2192 0.5.0breaking
Made it possible to use React in environments enforcing a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Security/CSP/Introducing_Content_Security_Policy). This also makes it possible to use React to build Chrome extensions.
- 0.4.1 \u2192 0.5.0breaking
No longer transform `class` to `className` as part of the transform! This is a breaking change - if you were using `class`, you *must* change this to `className` or your components will be visually broken.
- 0.4.1 \u2192 0.5.0breaking
Added warnings to the in-browser transformer to make it clear it is not intended for production use.
- 0.4.1 \u2192 0.5.0breaking
Improved compatibility for Windows
- 0.4.1 \u2192 0.5.0breaking
Improved support for maintaining line numbers when transforming.
- 0.4.1 \u2192 0.5.0deprecated
Introduced a separate build with several "addons" which we think can help improve the React experience. We plan to deprecate this in the long-term, instead shipping each as standalone pieces. [Read more in the docs](https://reactjs.org/docs/addons.html).
- 0.4.1 \u2192 0.5.0removed
Removed `React.autoBind` - This was deprecated in v0.4 and now properly removed.
- 0.4.1 \u2192 0.5.0renamed
Renamed `React.unmountAndReleaseReactRootNode` to `React.unmountComponentAtNode`.
- 0.13.3 \u2192 0.14.0api
The `props` object is now frozen, so mutating props after creating a component element is no longer supported. In most cases, [`React.cloneElement`](https://reactjs.org/docs/react-api.html#cloneelement) should be used instead. This change makes your components easier to reason about and enables the compiler optimizations mentioned above.
- 0.13.3 \u2192 0.14.0breaking
Add-Ons: Due to the DOM node refs change mentioned above, `TestUtils.findAllInRenderedTree` and related helpers are no longer able to take a DOM component, only a custom component.
- 0.13.3 \u2192 0.14.0breaking
Plain objects are no longer supported as React children; arrays should be used instead. You can use the [`createFragment`](https://reactjs.org/docs/create-fragment.html) helper to migrate, which now returns an array.
- 0.13.3 \u2192 0.14.0breaking
Web components (custom elements) now use native property names. Eg: `class` instead of `className`.
- 0.13.3 \u2192 0.14.0removed
Add-Ons: `classSet` has been removed. Use [classnames](https://github.com/JedWatson/classnames) instead.
- 0.13.3 \u2192 0.14.0removed
`React.initializeTouchEvents` is no longer necessary and has been removed completely. Touch events now work automatically.
- 0.12.2 \u2192 0.13.0breaking
Calls to `setState` in life-cycle methods are now always batched and therefore asynchronous. Previously the first call on the first mount was synchronous.
- 0.12.2 \u2192 0.13.0breaking
Static methods (defined in `statics`) are no longer autobound to the component class
- 0.12.2 \u2192 0.13.0breaking
`ref` resolution order has changed slightly such that a ref to a component is available immediately after its `componentDidMount` method is called; this change should be observable only if your component calls a parent component's callback within your `componentDidMount`, which is an anti-pattern and should be avoided regardless
- 0.12.2 \u2192 0.13.0breaking
`setState` and `forceUpdate` on an unmounted component now warns instead of throwing. That avoids a possible race condition with Promises.
- 0.12.2 \u2192 0.13.0deprecated
Deprecated patterns that warned in 0.12 no longer work: most prominently, calling component classes without using JSX or React.createElement and using non-component functions with JSX or createElement
- 0.12.2 \u2192 0.13.0deprecated
Mutating `props` after an element is created is deprecated and will cause warnings in development mode; future versions of React will incorporate performance optimizations assuming that props aren't mutated
- 0.12.2 \u2192 0.13.0removed
Access to most internal properties has been completely removed, including `this._pendingState` and `this._rootNodeID`.
- 0.11.2 \u2192 0.12.0behavior
Default prop resolution has moved to Element creation time instead of mount time, making them effectively static
- 0.11.2 \u2192 0.12.0breaking
Composite Component functions can no longer be called directly - they must be wrapped with `React.createFactory` first. This is handled for you when using JSX.
- 0.11.2 \u2192 0.12.0breaking
React is now BSD licensed with accompanying Patents grant
- 0.11.2 \u2192 0.12.0breaking
`key` and `ref` moved off props object, now accessible on the element directly
- 0.11.2 \u2192 0.12.0removed
`React.__internals` is removed - it was exposed for DevTools which no longer needs access
- 0.10.0 \u2192 0.11.0behavior
`getDefaultProps()` is now called once per class and shared across all instances
- 0.10.0 \u2192 0.11.0breaking
`React.isValidComponent` and `React.PropTypes.component` validate *descriptors*, not component instances
- 0.10.0 \u2192 0.11.0breaking
`MyComponent()` now returns a descriptor, not an instance
- 0.10.0 \u2192 0.11.0breaking
Custom `propType` validators should return an `Error` instead of logging directly
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/breaking/npm/react-is