JavaScript React Basics First Steps in React Create a React Element

James Roberts
James Roberts
9,208 Points

How to run this code in your own editor?

I'm a little confused. How do I run this code using my own text editor? I'm using Visual Studio. When I open the html file in browser, I get to failed to load resource errors and an uncaught reference error in the console. Do I need to set up my own server?

2 Answers

Juan Lopez
Juan Lopez
Full Stack JavaScript Techdegree Student 15,308 Points

Hey James, great question. In the previous lesson in the teachers notes there was a link on how to setup a local HTTP server. Setup Local Server.

Although if you would like since you mentioned that you are using Visual Studio Code for a text editor you could also search for the Live Server extension or click the link.

Once installed and you start the server you'll be able to go to localhost:8000(like Guil does) if you follow the teacher's notes version or localhost:3000(by default) if you use Live Server.

James Roberts
James Roberts
9,208 Points

Thanks Juan. I got it working.