Hacker News new | ask | show | jobs
by mtone 1191 days ago
I notice that ReactDOM.render is also deprecated.

In our embedded/plugin component scenario where we are given a <div> to load in, it appears we should replace our current pattern ReactDOM.render(React.createElement(... with createRoot(_jsx(....

1 comments

ReactDOM.render has been deprecated since React 18. If you're running React 18 with ReactDOM.render, you should already see an error urging you to switch because essentially ReactDOM.render works in React 17 mode.

Yeah you want

const root = createRoot(domNode) root.render(<Stuff />)

(or the JSX transform output equivalent)

We're not on 18 yet but things are clear, thanks!