Class components have built-in methods like componentWillMount, while functional components utilize ________ to achieve similar lifecycle behavior.
- useComponentWillMount
- useEffect
- useLifecycle
- useState
Class components have built-in lifecycle methods like componentWillMount, but functional components utilize the useEffect hook to achieve similar lifecycle behavior. The useEffect hook allows you to perform actions when the component mounts, updates, or unmounts, making it versatile for managing various lifecycle aspects in functional components.
Loading...
Related Quiz
- The method used to create a portal in React is called ________.
- Which of the following is NOT a core principle of Redux?
- What is the main advantage of using something like Redux over local state?
- What does "CSS-in-JS" mean in the context of React?
- In the context of React's lazy loading, what type of components can be directly imported using React.lazy()?