Skip to content

Upgrading react-test-renderer 16 to 17

Breaking16.14.0 → 17.0.2Breaking11Deprecated1New8Changed24Fixed25Other1

BreakingUpgrade verdict

11 breaking changes.

  • Synthetic events are no longer reused, so you can read event properties later without calling persist.
  • Removes unstable_discreteUpdates and unstable_flushDiscreteUpdates.
  • Removes the timeoutMs argument.
  • React now listens for events on each root rather than on the whole document, which changes how events behave in nested or multiple roots.
Top 4 of 12 that need code or config changes

Adds react-shallow-renderer ^16.13.1.

Drops prop-types.

Breaking11
Removes event pooling.
Removes unstable_discreteUpdates and unstable_flushDiscreteUpdates.
unstable_discreteUpdatesunstable_flushDiscreteUpdates
Removes the timeoutMs argument.
timeoutMs
Delegates events to roots instead of document.
Cleans up all effects before running any next effects.
Runs useEffect cleanup functions asynchronously.
useEffect
Stops emulating bubbling of the onScroll event.
onScroll
Throws if a forwardRef or memo component returns undefined.
forwardRefmemo
Stops 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.
Deprecated1
Deprecates the undocumented and misleading ReactTestUtils.SimulateNative API.
ReactTestUtils.SimulateNative