To store the previous state or props in functional components, you can use the ________ hook.

  • useEffect
  • useMemo
  • useRef
  • useState
To store the previous state or props in functional components, you can use the "useRef" hook. The useRef hook allows you to create mutable references to DOM elements and can be used to store previous values. While the other hooks (useState, useEffect, useMemo) are essential in functional components, they serve different purposes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *