Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Basics (2018) First Steps in React Render an Element

Louie Ambriz
Louie Ambriz
7,639 Points

Getting "Uncaught ReferenceError: react is not defined".

It's not great to be at the start of a course and following along exactly and get an error like this. It seems like I should be doing this project in a different way from what the video is showing. I know this seems like something basic.

Any suggestions?

3 Answers

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi Louie Ambriz,

It's hard to tell without seeing your code but it sounds like React is not being loaded into your project. Could you make sure that your script tags to the React cdn are present in your index.html file as well as your app.js file being loaded after those tags?

Hope this helps 🙂

<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="./app.js"></script>

Had the same problem. Turns out I wrote ReactDom instead of ReactDOM. Whenever you think you have followed the video step by step and still get an error, it could be spelling.

Diego Galaor Gutierrez Vazquez
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Diego Galaor Gutierrez Vazquez
Front End Web Development Techdegree Graduate 17,257 Points

I had the same problem. you have to download the library locally so your IDE can use the library for code competition, code spinets, etc. You can also just ignore it, your code would work just fine.