Building blocks

These are the key building blocks of React:

Following is the description of each block:

  • Components: React enables you to decompose your app's visual tree into smaller reusable units called components.
  • JSX: React's response to templates. JSX enables you to write components' template in code in a productive manner.
  • Props and state: Props enable parent-child component interaction, while state is used by components to manage its behavior.
  • Context: React supports a propagated context to be shared that is accessible through a visual tree that the context is applied to.
  • Virtual DOM: Essentially a JavaScript object graph, this is composed by React every time its state changes by traversing through the application components and calling their render function. The Virtual DOM reflects the actual HTML DOM and is a key part of React's reconciliation process, similar to the purpose of Angular's change detection.

Compared to Angular (React being a view engine), React has much fewer building blocks since it focuses on components alone.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.139.224