Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript React Basics 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?

1 Answer

Rohald van Merode
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>