So for reasons that I’m not going to explain, I’m developing a React application without bundlers (e.g., webpack). So basically I just include React and ReactDOM in a couple of <script>
tags in my index.html
, fetching those scripts from a CDN, for example:
https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js
https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js
So far so good, but now I decided to try and experiment with Suspense
and use
. The latter being a canary-only feature.
The first issue I faced is how to find the latest canary build, I assume it can be found in the CHANGELOG-canary.md file. Is this reliable?
Then I just updated the above URLs in my application, using the 18.3.0-canary-546178f91-20231005
version. But now I get two errors:
-
TypeError: Cannot read properties of undefined (reading 'unstable_cancelCallback')
; -
TypeError: ReactDOM.createRoot is not a function
.
It seems that, now, createRoot
has been moved in react-dom/client
. But what does it mean in terms of CDNs? It seems I cannot find it anywhere…