react breaking changes
npm5 curated breaking changes across major versions of react. Use this as a migration checklist before bumping dependencies.
- 18 \u2192 19api
useFormState renamed to useActionState and moved from react-dom to react.
Migration`import { useActionState } from 'react'` (was `useFormState` from react-dom). Signature is identical.
- 18 \u2192 19api
ref is now a regular prop on function components; forwardRef no longer required for most cases.
MigrationRemove forwardRef wrappers: `const Foo = ({ ref, ...props }) => ...`. Keep forwardRef only if you export to an external lib that still expects it.
- 18 \u2192 19removal
propTypes and contextTypes on class components silently ignored in production.
MigrationMigrate validation to TypeScript. Remove propTypes usage; keep only if you target React 18 simultaneously via a lib.
- 18 \u2192 19removal
defaultProps on function components removed. Use JavaScript default parameters instead.
MigrationReplace `Foo.defaultProps = { size: 'md' }` with `function Foo({ size = 'md' })`.
- 18 \u2192 19removal
String refs removed completely (were deprecated since v16).
MigrationUse callback refs or useRef. `ref="myRef"` is no longer supported.
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/breaking/npm/react