Skip to content
Advertisement

Cant import React

I started learning about React and I have problem with importing the library.

index.html:

JavaScript

script.js file:

JavaScript

Error I get when im opening the index file:

Cannot GET /ReactDOM%20%5E&%20JSX/index.html

I imported those 2 scripts from React site.

Advertisement

Answer

I noticed that the id on <div id="root"></div> is lowercase but in your JS script you’re selecting document.getElementById("Root") an uppercase id. document.getElementById is case sensitive, so your code will probably not render correctly.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement