React’s Components — The Building Blocks of React.js

React’s Components — The Building Blocks of React.js  #react #javascript #reactjs

  • There are a lot of things to think about when creating a component, but one important thing to remember is is to keep components small.It is pretty easy to create a component.First, component names always be capitalized.
  • In the below example, the component names are Welcome App.
  • The App component renders Welcome three times.In this particular example, the DOM renders the App component, which is made up of the Welcome component.
  • One thing that is important in knowing React.js components is this: All React components must act like pure functions with respect to their props.
  • Components can not modify their own props.Props is one way in which data is stored in React.

Components should be considered or looked at as the building blocks of React.js. Conceptually, they are similar to JavaScripts’ functions. There are a lot of things to think about when creating a…

@ReactDOM: React’s Components — The Building Blocks of React.js #react #javascript #reactjs

React’s Components — The Building Blocks of React.js

Components should be considered or looked at as the building blocks of React.js. Conceptually, they are similar to JavaScripts’ functions. There are a lot of things to think about when creating a component, but one important thing to remember is is to keep components small.

It is pretty easy to create a component.

First, component names always be capitalized. In the below example, the component names are Welcome & App. The App component renders Welcome three times.

In this particular example, the DOM renders the App component, which is made up of the Welcome component. One thing that is important in knowing React.js & components is this: All React components must act like pure functions with respect to their props. Components can not modify their own props.

Props is one way in which data is stored in React. Another way is state. Props are immutable while state is mutable.

React’s Components — The Building Blocks of React.js