This is going to be a short piece with rich content. React is a library built for JavaScript which allows you to say what you want to do instead of doing it.
What do I mean by that? If you have a cook in
the house, you tell them what you want to be made today. You don't go ahead and
tell them this should be the amount of sugar this should be the amount of water
they should use or this should be the amount of spice that should use and so on.
Similarly, in JavaScript, if you're writing
JavaScript, you have to define every single thing that needs to be done, what
needs to go where, and so on.
React
is declarative like a library. That means you just need to tell react. Here's
my placeholder. Here's my state and I'm going to update my state.
React would automatically take care of all
the updates which you see on the screen. That means you just tell react what
you want to do, how it has been done that is handled by the react itself.