Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no public/index.html to start the app #3

Open
hisandan opened this issue Mar 31, 2023 · 1 comment
Open

There is no public/index.html to start the app #3

hisandan opened this issue Mar 31, 2023 · 1 comment

Comments

@hisandan
Copy link

After npm start Index.js search for the 'root' div, with the following command: document.getElementById('root')

This element have to be in public/index.html file or the app will not run.

@hisandan
Copy link
Author

It is also necessary to use in index.html:

const root = ReactDOM.createRoot(document.getElementById("root")); root.render( <React.StrictMode> <App /> </React.StrictMode> );

instead of

ReactDOM.render( <React.StrictMode> <App /> </React.StrictMode>, document.getElementById('root') );

because the last is no longer supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant