React hook

React is a JavaScript based front end library. Other than root html element everything is being made with JavaScript.

React build a virtual dom. With this DOM react select which element should be rendered and which one should not.

React also has some kind of special thing which is called hooks. with the help of virtual dom hook identify exactly which element should be rendered.

  1. useEffect
  2. useState
  3. useRef
  4. useReducer
  5. useHistory

useEffect is used for fetching data, rendering thing for specific changes.

useState is used for storing data.

useRef is used for selecting specific element.

useReducer is used for storing data.

useHistory is used fot getting location.

The End!

--

--