In this lecture, we will have a brief introduction to React. We will learn what exactly is React and why do we need it. So, what exactly is React?
React is an open source JavaScript library for creating user interfaces. So, we all know that React is actually based on JavaScript. It's a JavaScript library.
It's not a framework. And it's a library which is used for creating user interfaces. So we all know that JavaScript is generally used to make our web pages interactive. And React is a library which is built on top of JavaScript, which uses JavaScript so that we could build user interfaces.
React is used for building user interfaces, and it's not responsible for routing or making HTTP requests. So one thing which you need to understand is React is a front end framework, because it can only be used to build user interfaces and it does not deal with the server side. So for example, frameworks like Django are the frameworks which deal with the server side stuff like making HTTP requests or routing.
However, React does not handle that. React only deals with the front end stuff like the components, the buttons, the elements on your web page. So as React is a front end framework, we can say that react is used for handling the view layer of our application so in general whenever you are developing an application there are multiple layers of an application there's model there's view there's controller and react actually deals with the view layer of application which basically is the layer which is responsible for how the application looks like and how the application is interacted with it allows us to create large web applications that can change data without reloading the web page. Now this is one interesting fact about react. Let's say you're creating a web application and let's say some data on that particular page of the web application needs to change.
So whenever you are using a backend framework like django, generally when you want to change data on the web page you have to reload the entire page. But that is not the case with react. Let's say if you want to change a certain set of data, then only that part of the web page would be changed and you don't need to actually reload the entire page to change that specific point of data.
So this is another cool feature of React, which is why React is used. Now, the next question is why exactly you should learn React. So one of the best reasons to learn React is React is created and maintained by Facebook.
So the React library was developed by Facebook developers because they actually wanted a library which would help them build components for Facebook. So as it is created and maintained by Facebook, it has a lot of support. It has a good set of documentation and it has a good community of developers which support it.
So that means if you run into any sort of problem, you will be able to find solutions for that specific problem. The next reason is... It is simple and it uses a special syntax called as JSX which allows you to mix HTML with JavaScript. So another best thing about React is that it's relatively simpler to use and simpler to learn because it uses something which is called as JSX and using JSX you can actually write React components using HTML and JavaScript itself.
That means if you know a little bit of JavaScript and if you know a little bit of HTML, you will be able to learn react in a relatively simple fashion. The third point is easy to learn. You simply need to know HTML, CSS and a bit of JS to start learning react. So this is what has been already mentioned.
You just need to know a little bit of HTML, CSS and you also need to know a little bit of modern JavaScript as well, especially the ES6 syntax so as to start learning react. The next reason is react is an in demand skill set. by a lot of companies. So if you apply for jobs in tech companies these days, especially if you're applying for a front-end developer role, chances are that company requires you to know React. Because React is one of the most popular libraries used for building front-end components or front-end of any web application.
The next best thing about React and why you should learn it is that it can be used in any tech stack. So for example, if you're building a web application, There are a certain set of technologies which you need to use. You need to have a database, you need to have a back-end framework, you need to have front-end frameworks like bootstrap, so on and so forth. So the best part about React is that no matter what technologies you have in your stack, React will actually fit right in in all of those technologies.
So for example, you could be using Django for backend, you could be using a MongoDB database, or you could be simply using Firebase as your database. In all those cases, you could use React in the frontend and have any of the other frameworks in the backend. And even in the frontend as well, You could use different frameworks like Bootstrap or Tailwind etc. And it fits right in with React.
The next best thing about learning React is that once you learn React, you can actually jump into mobile application development using React Native. So React Native is nothing but it's sort of like a platform which allows you to develop mobile applications for both iOS and Android. So that means you have to write code only once. and the code written in react native will transpile into an android app as well as an ios app so you don't have to learn languages like java kotlin or swift which are actually required for native application development instead you could simply use your react knowledge and use react native to build those mobile applications so after completing this course you won't just be able to build web applications but you will also be able to build mobile applications as well for android as well as ios so these were the benefits or i could say reasons why you should learn react and i hope that's motivating and inspiring enough to make you continue this journey of learning react now once we know what is react why it is used and why exactly you should learn it you need to understand the component based architecture of react so Whenever you're creating a react application you need to understand that react is based on component architecture.
So what exactly is the component based architecture? Whenever you take an example of any application every application could be broken down into small multiple components. So for example let's say if you consider Instagram, Instagram would have such kind of a interface wherein you have the image and you have these buttons over here at the bottom.
Now This is the user interface which you are able to take a look at. However, this entire huge interface can be divided into multiple small components. So the image over here would be one component, the like button is another component, the chat or comment button would be another component, so on and so forth. So all these components combined together form user interface and React is based on the similar approach.
So with React, what you essentially do is that you are able to design these individual components. You can then combine these components together to form your entire user interface. Now the question is, why would you use components?
The main reason why we use components or why we follow component-based architecture in React is that components allow reuse of code. That means once you create one component, that component could be used multiple times. So, So consider Instagram as an example.
When you see this particular user interface for one of your friends photos on Instagram, you will also observe that the same interface is also used for your other friends profiles as well. So for example, if you visit the profile page of one of your friends, you will have a certain structure of that page and that structure is defined by components. And when you visit some other friends, Instagram page or Instagram profile you will see that those same components are used on his or her page as well but the only difference is that the content changes but the structure remains the same and this is only possible because the component which was initially created are reused multiple times.
So this is why React uses a component-based architecture. We will learn more about component based architecture in the lectures to come. However... This level of understanding about components is enough for now.
So that's it for this specific lecture. And I hope that you got a brief idea about what exactly is React, why it is used, why you should learn it, and what is component-based architecture. So from the next lecture onwards, let's actually dive right into learning React.
So thank you very much for watching, and I'll see you guys in the next one. Thank you.