React setup : running our app
let's have a look at that app on a browser!
Last updated
let's have a look at that app on a browser!
Last updated
Finally, we can run our app!
In the Terminal, we would simply run the following command:
We should see something like:
Then, from our browser, we go to localhost:3000
and we should see something like:
"A child component!" lives in src/Component.js
src/Component.js
gets imported by src/App.js
src/App.js
gets imported by src/index.js
src/index.js
builds upon public/index.html
Clearly, the powerful implications of React components already appear in this very basic static "app" in terms of:
re-usability
we could include <Component />
as many times in as many places as we wish, in src/App.js
division of labour
if we want to expand upon src/Component.js
we could do so without affecting the rest of src/App.js
portability
keeping things in smaller components makes code easier to read
We have covered quite a bit here, starting from nothing and ending with a basic static app - but more exciting topics lie ahead! More, such as:
building the app
deploying the app to the internet
creating dynamic components
building the illusion of a multi-page website through routes
Developers never get bored!