Upgrading react-test-renderer 15 to 16
Breaking15.7.0 → 16.14.0Breaking35Security1Platform1Deprecated8New72Changed79Fixed151Other2
SecurityFixes a potential XSS vulnerability when an attacker controls an attribute name (CVE-2018-6341).CVE-2018-6341 ↗
BreakingUpgrade verdict
35 breaking changes and a platform requirement change and a security fix.
In plain terms
- The callback parameters of ReactDOM.createRoot() are removed, and using them now triggers warnings.
- Code using the old concurrent mode API must switch to the new root API.
- The experimental AsyncMode export has a new name.
- The experimental Placeholder component and its delayMs prop have new names.
Must act Top 5 of 45 that need code or config changes
Adds prop-types ^15.6.2, react-is ^16.8.6, scheduler ^0.19.1.
Drops fbjs.
Installs 6 packages in all (was 16).
What you must change
Breaking35
Removes ReactDOM.createRoot() callback params and adds warnings on usage.
ReactDOM.createRoot()Removes unstable_ConcurrentMode in favor of unstable_createRoot.
unstable_ConcurrentModeunstable_createRootRenames unstable_AsyncMode to unstable_ConcurrentMode.
unstable_AsyncModeunstable_ConcurrentModeRenames unstable_Placeholder to Suspense and delayMs to maxDuration.
unstable_PlaceholderSuspensedelayMsmaxDurationRenames the Scheduler package to scheduler.
schedulerRenames the "tracking" API to "tracing".
trackingtracingRemoves
unstable_deferredUpdates in favor of unstable_scheduleWork from schedule.unstable_deferredUpdatesunstable_scheduleWorkscheduleRemoves
useSyncScheduling from the React Reconciler host config.useSyncSchedulingCalling setState with null no longer triggers an update.
setStatecomponentDidUpdate no longer receives the prevContext parameter.
componentDidUpdateprevContextShallow renderer no longer calls componentDidUpdate() because DOM refs are not available.
componentDidUpdate()componentDidMount()Shallow renderer no longer implements unstable_batchedUpdates().
unstable_batchedUpdates()Errors in render and lifecycle methods now unmount the component tree by default.
Removes the react-with-addons.js build; compatible addons are published separately on npm.
react-with-addons.jsRemoves the experimental
unstable_createRoot and unstable_createSyncRoot APIs, now available in the Experimental channel as createRoot and createSyncRoot.unstable_createRootunstable_createSyncRootcreateRootcreateSyncRootEffect clean-up functions must return either undefined or a function; all other values, including null, are not allowed.
Scheduler switches from the deadline object to the shouldYield API.
shouldYieldDeletes the experimental React Call Return API due to bundle size impact and API quality.
Replaces React.unstable_AsyncComponent with React.unstable_AsyncMode.
React.unstable_AsyncComponentReact.unstable_AsyncModeChanges the hydration API for better Flow typing.
ReactDOM.render() and ReactDOM.unstable_renderIntoContainer() now return null when called inside a lifecycle method.
ReactDOM.render()ReactDOM.unstable_renderIntoContainer()Calling setState directly in render now always causes an update.
setStaterenderThe setState callback now fires immediately after componentDidMount or componentDidUpdate instead of after all components rendered.
setStatecomponentDidMountcomponentDidUpdateWhen replacing <A /> with <B />, B.componentWillMount now always runs before A.componentWillUnmount.
componentWillMountcomponentWillUnmountChanging a component's ref now detaches later, when applying DOM changes, instead of before render.
refRe-rendering into a container modified by something other than React now emits a warning.
ReactDOM.unmountComponentAtNodeNon-unique keys may now cause children to be duplicated or omitted instead of raising a hard error.
keyReactDOM.unstable_batchedUpdates now only takes one extra argument after the callback.
ReactDOM.unstable_batchedUpdatesSingle-file browser build names and paths changed to distinguish development and production builds.
react/dist/react.jsreact/dist/react.min.jsreact-dom/dist/react-dom.jsreact-dom/dist/react-dom.min.jsServer renderer rewritten: no markup validation, no comments for empty components, no data-reactid attributes.
data-reactidHydrating server rendered HTML now requires ReactDOM.hydrate instead of ReactDOM.render.
ReactDOM.hydrateReactDOM.renderUnknown props passed to DOM components now render in the DOM for valid values.
Removes 15.x deprecations from core: React.createClass, React.PropTypes, React.DOM, react-addons-test-utils and shallow renderer move to separate packages.
React.createClassReact.PropTypesReact.DOMreact-addons-test-utilsreact-test-renderer/shallowChanges internal event names, which can break third-party packages relying on React internals.
Changes the experimental React Reconciler host config shape to be flat without nested objects.
Security1
Fixes a potential XSS vulnerability when an attacker controls an attribute name (CVE-2018-6341).
Platform1
Adds a peer dependency on React 16.3+ for Create Subscription.
Deprecations to plan for
Deprecated8
Deprecates React.createFactory().
React.createFactory()Deprecates unstable_createPortal.
unstable_createPortalDeprecates old names for the UNSAFE_* lifecycle methods.
UNSAFE_componentWillMountUNSAFE_componentWillReceivePropsUNSAFE_componentWillUpdateDeprecates javascript: URLs as a common attack surface.
Deprecates uncommon module pattern (factory) components.
Deprecates the Jest-specific
ReactTestUtils.mockComponent() helper.ReactTestUtils.mockComponent()Deprecate
ReactDOM.unstable_createPortal() in favor of ReactDOM.createPortal().ReactDOM.unstable_createPortal()ReactDOM.createPortal()Stops publishing new releases on Bower starting with 16.1.0; old releases remain available and Bower configs can point to React UMD builds on unpkg.