Upgrading react 16 to 17
Breaking16.14.0 → 17.0.2Breaking11Deprecated1New8Changed23Fixed25Other2
BreakingUpgrade verdict
11 breaking changes.
In plain terms
- Synthetic event objects are no longer reused, so they stay valid after the handler returns.
- Removes unstable_discreteUpdates and unstable_flushDiscreteUpdates.
- Removes the timeoutMs argument.
- React now listens for events on each app root rather than on the whole page document.
Must act Top 4 of 12 that need code or config changes
Drops prop-types.
Installs 3 packages in all (was 5).
What you must change
Breaking11
Removes event pooling.
Removes unstable_discreteUpdates and unstable_flushDiscreteUpdates.
unstable_discreteUpdatesunstable_flushDiscreteUpdatesRemoves the timeoutMs argument.
timeoutMsDelegates events to roots instead of document.
Cleans up all effects before running any next effects.
Runs useEffect cleanup functions asynchronously.
useEffectStops emulating bubbling of the onScroll event.
onScrollThrows if a forwardRef or memo component returns undefined.
forwardRefmemoStops exposing internals that won't be needed by React Native Web.
Disables <div hidden /> prerendering in favor of a different future API.
Adds the unstable_ prefix before the experimental APIs.
Deprecations to plan for
Deprecated1
Deprecates the undocumented and misleading ReactTestUtils.SimulateNative API.
ReactTestUtils.SimulateNative