redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

React Optimistic Updates example got TypeError (0 , $csb__react_dom.render) is not a function

Open a90100 opened this issue 9 months ago • 3 comments

Steps to reproduce the issue:

  1. Oepn the URL https://redux-toolkit.js.org/rtk-query/usage/examples#react-optimistic-updates
  2. Click to run the example and you will see the TypeError (0 , $csb__react_dom.render) is not a function

Image

The way I found to solve the issue:

Downgrade the react and react-dom packages to version 18.0.0.

There might be a better way to solve this issue, but I'm just providing a solution.

a90100 avatar Mar 14 '25 11:03 a90100

Hmm. That's extremely odd, given that we don't even call the old ReactDOM.render() method:

worker.start({ quiet: true }).then(() =>
  ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
    <React.StrictMode>
      <ApiProvider api={api}>
        <ChakraProvider>
          <BrowserRouter>
            <App />
          </BrowserRouter>
        </ChakraProvider>
      </ApiProvider>
    </React.StrictMode>,
  ),
)

markerikson avatar Mar 15 '25 01:03 markerikson