"# ReactTraining"

React Hooks

Some of the popular ones include:

useState: returns a stateful value useEffect: perform side effects from function components useContext: accepts a context objects and returns current context value useCallback: pass an inline callback and an array of dependencies

Some benefits of hooks are:

  • Isolating stateful logic, making it easier to test
  • Sharing stateful logic without render props or higher-order components
  • Separating your app’s concerns based on logic
  • Avoiding ES6 classes