I've decided to dive into React and will be making a blog-series on react as I learn it.
Note: Take a look at
this post first to get a feel of some JavaScript syntax that is used in React.
React is a popular JavaScript library used mostly in building user-interfaces.
Let's have a look at what a React application(not really an app) looks like:
First, To setup a simple react-environment, make sure node-js is installed, then open the terminal and navigate(in-terminal) to a directory where you would like the react-project to be in then write this command in the terminal
npx create-react-app name-of-project
This will use a package "create-react-app"( used for generating react projects ) to generate a react project in a folder "name-of-project". It downloads the react library along with some other dependencies and useful tools, then sets up a template for a project.
With the react environment successfully setup there should be a couple of folders like 'public, src, node_modules'.
public: holds static files like the html files
src: holds the react source code we're working on
node_modules: holds dependencies of the project
Delete the files in 'src' folder and then create a fresh js file in there called 'index.js' and we can begin to code in React.
Top comments (0)