Legacy React APIs
These APIs are exported from the react package, but they are not recommended for use in newly written code. See the linked individual API pages for the suggested alternatives.
Legacy APIs
Childrenlets you manipulate and transform the JSX received as thechildrenprop. See alternatives.cloneElementlets you create a React element using another element as a starting point. See alternatives.Componentlets you define a React component as a JavaScript class. See alternatives.createElementlets you create a React element. Typically, you’ll use JSX instead.createRefcreates a ref object which can contain arbitrary value. See alternatives.forwardReflets your component expose a DOM node to parent component with a ref.isValidElementchecks whether a value is a React element. Typically used withcloneElement.PureComponentis similar toComponent, but it skip re-renders with same props. See alternatives.
Removed APIs
These APIs were removed in React 19:
createFactory: use JSX instead.- Class Components:
static contextTypes: usestatic contextTypeinstead. - Class Components:
static childContextTypes: usestatic contextTypeinstead. - Class Components:
static getChildContext: useContextinstead. - Class Components:
static propTypes: use a type system like TypeScript instead. - Class Components:
this.refs: usecreateRefinstead.