from React Beginner Tutorial

Hooks

React入門チュートリアル (7) カスタムフック | Hypertext Candy

  • Hooks are like events that are triggered by data changes.
  • I don’t quite understand the meaning of use (what is being used).
  • The intention is to allow the use of React’s things in functional components.
    • Is that what use is for?
    • Is it better to use functional components + Hooks rather than class components?
      • Introduction to React Hooks for Beginners
      • Hooks are different. Each feature is encapsulated within a single Hook. It is a characteristic that concerns are grouped together in a single Hook, such as “reading and updating values” or “subscribing and unsubscribing to a stream”.

      • Compared to class components that become complex and disordered by writing everywhere, functional components and Hooks, which achieve “each feature in one place,” can be said to be the heroes that save React.

    • [/villagepump/React Hooks](https://scrapbox.io/villagepump/React Hooks)
    • The XXX in useXXX is used from React, right?
      • XXX depends on React.
  • Hooks (use___) are used when you want to wrap the processing of interactions with the outside world.
    • Outside world: APIs for asynchronous communication or React’s state, etc.
    • Receiving events such as value updates.
    • Setting values.