Photo by Christin Hume on Unsplash
Introduction to React for Beginners
A step-by-step guide to developing Web Apps with react
What is React?
React (also known as React.js) is a JavaScript framework used to create fast user interfaces for websites and applications. React was developed by Facebook, now Meta, in 2011/2012.
My favorite thing about React is its simplicity and ease of use.
In this article, we will explore how to set up react, and all you need to run react smoothly.
How to install React for beginners
Before you can use React, node.js must be installed in your system. When you successfully install node.js, it will come with a package manager called npm. Both are required in other to get the full React experience.
To download Node, go to https://nodejs.org/en/. After downloading, make sure to properly install both Node and npm.
To check if they were installed successfully, go to your command line and type
node -v
npm -v
The above commands will show you the downloaded versions, only if your download was successful.
How to setup React projects
Open your terminal and type
npx create-react-app (name of application)
This creates a React application folder. When you open the folder. you will notice already created folders thus:
node_modules
public
src
These folders contain all the dependencies you need to complete projects. You can delete all the files in the public folder
except for the index.html
and manifest.json
. You can also delete all the files in the src folder
other than App.css
, App.js
, and index.js
.
I hope you found this guide helpful. Happy coding!