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.
Loading...
Related Quiz
- You've been tasked with adding real-time map updates in a logistics application using React. Which combination of technologies would be most effective?
- Which of the following is NOT true regarding error boundaries?
- What is Jest?
- To set an initial state in a class component, the ________ property is used.
- What is the main advantage of using fireEvent from React Testing Library?