JavaScript React Basics First Steps in React Render an Element

Seb Gates
Seb Gates
10,186 Points

Hi, I am trying to see the output in a browser. Guil is using localhost:8000. I have tried this and nothing renders.

I also try to view the output by viewing the file path file:///Users/sebgates/react/index.html - Still nothing. When I used http server in another course, I ran the project on localhost:3000. We did not set up http server in this course. I also tried tutorials here: https://reactjs.org/docs/getting-started.html and they worked by viewing the file path in a browser - so I can render React components using tutorials on https://reactjs.org using a CDN. Am I missing something obvious?

4 Answers

Jaime Serradell
Jaime Serradell
3,348 Points

Mac: in the terminal you have to place into the scoreboard folder and then write "python -m SimpleHTTPServer". After this, you can access by localhost:8000 on google chrome. Hope I helped you

You can install an npm http server to view on a browser. run the install while on the path of your project file and you should be good to go. see link below on how to download the http server. This server will listen on port 8080. https://www.npmjs.com/package/http-server

L Haney
L Haney
Pro Student 10,260 Points

Can you post some code examples on how you did it? A lot of us are struggling with this.

it doesn't working with me nothing shown I'm using windows 10

Tai Huynh
Tai Huynh
7,089 Points

(MAC user with test server using python3) Use http://0.0.0.0:8000/ install of localhost.8000.