Image for post
Image for post
Photo by Lou Brassard on Unsplash

React is declarative. It’s almost the first thing you are told about the library in its home page:

A capture of React docs front page, with an arrow pointing to the heading “declarative”.
A capture of React docs front page, with an arrow pointing to the heading “declarative”.

But, what does it mean? “Declarative”, at least in the programming sense, is usually defined as “telling what to do instead of how to do it”. When we talk about React being declarative, the most common explanation revolves around how when you write a component, you just tell React what do you want the DOM to look like, and just let React handle it from there. You don’t have to worry about how the different elements currently in the web page have to change, or which ones have to be removed or inserted. You just say “I want a button there, and I want it disabled”, and React makes it happen. “Now I want the button to be enabled”. …

About

Asís García

Developer @Trabe

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store