react.dev
react.dev copied to clipboard
[Bug]: 'Render React components anywhere on the page' sandbox does not work
trafficstars
Summary
When you go to the relevant sandbox you see that it throws an error in the console. The problem occurs because there are two index.html files in the project. One in the project root directory and the other in the public directory. Simply replacing the one in the public directory with the one in the root directory solves the issue.
Page
https://react.dev/learn/add-react-to-an-existing-project#step-2-render-react-components-anywhere-on-the-page
Details
No response