Want to discover some simple ways to learn React in 2024? This guide is for people who are starting with React or who have gone through React as a beginner and unsure on what to pick up next as an advanced React developer.
In this guide, I want to give beginners as well as advanced React developer a comprehensive overview of how to approach learning React without getting distracted or overwhelmed by other topics along the way.
I have to tell this right away though that this path is my personal opinion and is by no means an exhaustive list of what you should be learning in React.
Why React is so popular
React is one of the best JavaScript library which has grown by leaps and bounds in recent years. Though there are other front-end frameworks like Angular and Vue.js available, what sets React apart from others is the fact that it just focuses on component-based GUI development and doesn’t invade on other areas.
Traditionally when you access a website through a browser. Your browser send a request to sever for the HTML page, and once it receives that particular HTML page then it display on the browser.
But whenever you go to a different part of the site, the browser will do a full refresh, it will get more HTML from the server, and that new page will be displayed.
In other words, websites are traditionally server-side rendered.
But as time progressed, developers converged on a different pattern for building web sites, called web apps.
What’s the difference?
There’s really no strict difference, but the term “web app” came about to describe these web sites which were made to be more interactive and perceptibly faster.
In a web app, otherwise known as a single-page app (SPA), the browser will still load the first page you see by getting HTML, but it will also receive the CSS and JavaScript required for every page of the app, not just a single page.
What is the innovation?
It is for single-page app (SPA) to use JavaScript, a language which runs in every browser, to fetch data from the server to display new pages. Instead of fetching HTML from the server, however, it fetched a different type of data known as JSON (JavaScript Object Notation).
So when a user changes the page, JavaScript fetches the necessary JSON data for the new page from the server and then JavaScript would update the existing HTML with that new data to show the appropriate content.
This, as compared to server-side rendering, is known as client-side rendering.
In client-side rendering, JavaScript is responsible for controlling the entire app. This is what paved the way for React.
React was not an overnight success, however prior to React, developers were taught the benefit of creating websites with separate HTML, CSS, and JavaScript, all living in separate files. The logic behind this concept was that programmers could more clearly reason and develop each part of their project with such divisions in place.
But React threw that concept right out of the window. And surprisingly for this, React was not well received at first by the developer community.
But with time and by using React in real-world projects web developers gradually embraced React as a powerful new way of uniting all of the necessary parts of any web application.
Now you must understood why React is so popular these days and why you should learn it. Before learning any technology there are some prerequisites, same with React too. Let me tell you what are the minimum prerequisites to learn React.
What are React prerequisites to learn
Since React is a JavaScript library and makes heavily use of JavaScript so you need to learn it in the first place. To get started you should at least know the following features of JavaScript:
- ES6 Class
- this keyword
- Map function
- Destructuring
- Error handling
- Arrow function
- Imports and Exports
- Let, const, var keyword
- bind(), apply(), and call()
- Callbacks and Promises
- Event loop and bubbling
- Scopes, hoisting and closures
Beside JavaScript you should have good knowledge of HTML, CSS and basic understanding of how to use npm.
Must Read: npm Cheat Sheet
I personally believe most of the advanced JavaScript features can be learned along the way when learning React.
Add comment