React Fundamentals : Declarative | Component Based | Library

Hey I am Anjali 😀
Search for a command to run...

Hey I am Anjali 😀
Great post. Talking about React, you can use the React Admin Templates to boost the workflow.
Authentication is a fundamental aspect of modern web and mobile applications. It ensures that users can securely access an app while protecting their data. Firebase, a platform developed by Google, offers a simple and efficient way to add authenticat...

Hello there! My name is Shivam, and today, I will show you how to create this beautiful horizontal scrolling parallax effect with HTML, CSS, and JavaScript. Wouldn't this look stunning on your blog or portfolio site? To achieve this effect, we will ...

Dealing with fonts can get quite overwhelming. For quite some time, I was searching for a way to self-host google fonts because the google fonts API's network request increased the render-blocking time more than I expected. I stumbled upon fontsource...

Our favorite month is here! And we have some amazing activities planned for our community 🤩 Yes, you are right. We are talking about Hacktoberfest! In this blog, we want to cover various ways you can participate in Hacktoberfest through the ReactPla...

The second edition of ReactPlay Hackathon is here!

React is Declarative, Component-Based, JS Library for building user Interfaces



In Vanilla JS, we need to do querySelector / getElementById and where to put the Id. But in React, we say This is my Browser..I want this UI , your job is to do it.
Declarative is telling what to do instead of how to do it 📝
You just tell React what do you want the DOM to look like, and just let React handle it from there
This means we never interact with DOM, the UI is updated when we change the state.
You describe the program/UI/picture and someone else React/Browser/OS implements it.
It describe the solution instead of procedure.
We create independent component that are reusable , self contained and isolated. In React.js, components can be Class Based or Function Based.
Component is Javascript Function, which can take argument and always return JSX, has Private data as states and when has to interact with other components, it passes props (pass from top to down)

State : like local variable to a function through a component
Props : pass as an argument to another component so that you can exchange data
Props = Pass + Top to Down
Component should be Pure Function (for same input should produce same output)
How to Identify A Component ? 🧐
Library Refers to reusable code written by someone else that helps you perform some common tasks.
React can be easily plugged into an existing technology stack - and that’s the definition of a library.
The purpose of the library is to control the flow of the application. The purpose of the framework is to be in charge of the flow.
Another reason for React to be a library and not a framework is the amount of flexibility it provides to users. It provides much more flexibility to users compared to a framework.
