1)What is react?
React is a JavaScript library used to build user interfaces, especially single-page applications (SPAs) where the page updates without reloading.
It is component-based, meaning the UI is divided into small, reusable components.
It uses Virtual DOM, which updates only the required part of the page, making apps faster.
2)Why we use react?
Reusable components – We can reuse the same component multiple times, which reduces code duplication. [to be discussed]
Fast performance – React uses Virtual DOM to update only the changed parts of the UI.
Easy to manage complex UI – React makes it easier to build and maintain large applications.
3)Why react was created?
Earlier, websites used plain HTML + CSS + JavaScript.
As apps became bigger (like Facebook, Instagram), managing the UI with normal JS became hard and messy.
So Facebook created React (2013) to:
- Make UI development easier
- Update only the required part of the page
- Reuse UI pieces instead of rewriting code
Top comments (0)