Renders a React component using either createRoot from react-dom/client (React 18+) or render from ReactDOM (React 17 and below).
This is currently only needed for Divi compatibility as Divi is still using React v16 and WordPress < 6.2 as it uses React v17.
We are using a custom webpack configuration to replace the react-dom/client dependency with our own package.
https://app.clickup.com/t/86959qqq1
When we drop support for WordPress < 6.2 we can safely migrate to createRoot()
createRoot()
Renders a React component using either createRoot from react-dom/client (React 18+) or render from ReactDOM (React 17 and below).
This is currently only needed for Divi compatibility as Divi is still using React v16 and WordPress < 6.2 as it uses React v17.
We are using a custom webpack configuration to replace the react-dom/client dependency with our own package.