Skip to content

Latest commit

 

History

History
19 lines (18 loc) · 720 Bytes

README.md

File metadata and controls

19 lines (18 loc) · 720 Bytes

React Hooks

  • What are "React Hooks"?
    • React Hooks are special functions that can only be used in functional components (and custom hooks)
      • For example, useState(), useEffect, useXYZ()
    • These functions add extra capabilities to functional components
      • For example, useState() adds functionality that allows functional components to manage internal state
  • Using React Hooks With Functional Components
    • useState
    • useEffect
    • useCallback
    • useRef
    • useMemo
    • useContext
    • useReducer
    • and so on
  • Rules of Hooks & Custom Hooks
    • You must only use the hooks in functional components or inside other custom hooks
    • Always have to use hooks on the root level of your component