Reaction Concept: Declarative

What does it mean when you read that React is declarative

You will iterate through articles describing ReactDeclarative way to build UI.

React makes its "declarative approach" very popular and early stage, so it penetrates the front-end world together with React.

This is really not a new concept, but React has more ways to build UI declaratively than using HTML templates:

  • You can even build a web interface without directly touching the DOM
  • You can have an event system without having to interact with actual DOM events.

The opposite of declarative isCritical. A common example of an imperative approach is to use jQuery or DOM events to find elements in the DOM. You can tell the browser exactly what to do, instead of telling the browser what you need.

The React declarative approach abstracts this for us. We just tell React that we want the component to be rendered in a specific way, and we don't have to interact with the DOM to refer to it in the future.

Download mine for freeResponse Handbook

More response tutorials: