What if the React CDN scripts fail to load?
Some networks block CDNs. Try a different CDN URL, or move to a local setup with npm and a bundler, which is more reliable and is how real projects work anyway.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Common Errors When Setting Up React via CDN and How to Fix Them
Either the React script did not load, or your code ran before the script loaded. Make sure the script tags are placed before your code and that you have an internet connection so the CDN loads.
You are using an old version of ReactDOM that only had ReactDOM.render. createRoot was introduced in React 18. Update your CDN scripts to React 18 or newer to use it.
Regular script tags do not understand JSX. You need to add type='text/babel' to the script and include the Babel standalone script, or use a build tool that compiles JSX for you.
Still have questions?
Browse all our FAQs or reach out to our support team
