redux-toolkit
redux-toolkit copied to clipboard
React Optimistic Updates example got TypeError (0 , $csb__react_dom.render) is not a function
Steps to reproduce the issue:
- Oepn the URL https://redux-toolkit.js.org/rtk-query/usage/examples#react-optimistic-updates
- Click to run the example and you will see the TypeError (0 , $csb__react_dom.render) is not a function
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.
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>,
),
)