Question · JavaScript and React course · Module 5: useEffect and Custom Hooks
Lifecycle Method Mapping
Which React hook replaces the componentDidMount method from class components?
Answer options
- useState
- useEffect with an empty dependency array []
- useRef
- useMemo
You can check the correct answer by solving this task in the CodeWorlds game.