Deprecations removed in ReactDeprecaciones eliminadas en React
Removing deprecations in React DOMEliminación de deprecaciones en React DOM
Removed deprecated TypeScript typesEliminados tipos TypeScript deprecados
Download the article in PDF
As WordPress developers , we often integrate custom React compo cameroon consumer mobile number list nents into our themes and plugins to create dynamic and responsive user interfaces.
With the upcoming release of React 19 , it’s crucial to prepare for changes and deprecations that could impact our existing codebases. WordPress 6.6 , which will be released on July 16, includes React 18.3. This version is nearly identical to 18.2, but adds warnings about deprecated features to help you prepare for React 19.
Addressing these deprecations is essential to ensure compatibility with React 19, and ignoring them can lead to errors or issues in your custom blocks , plugins, or themes when React 19 is released and included in WordPress.
This article details each deprecation, provides code examples, and walks you through the process of replacing deprecated functionality to maintain smooth operation.

To help you with the upgrade, the React team has worked with the Codemod team to release codemods that will automatically update your code to many of the new APIs and patterns in React 19.
All codemods are available in the react-codemod repository on GitHub. Additionally, we will attach the codemod command for each deprecation (if available) to help you automatically update your code.
Deprecations removed in React
Several deprecated APIs and functions have been removed to st reamline the React library and encourage best practices. This section explains the most important changes and how to update your code accordingly.
1. Removing defaultProps for function components
React 19 will remove function components in favor of ES6defaultProps default parameters . According to the WordPress team , this deprecation is most common in plugins and themes.
As a WordPress developer, you may use defaultPropsto provide default values for props in your function components, ensuring that the components behave correctly even if certain props are not passed.
This is what your current code might look like with defaultProps:
function CustomButton({ label, color }) {
return <button style={{ backgroundColor: color }}>{ label }</button>;
}
CustomButton.defaultProps = {
label: 'Click me',
color: 'blue',
};