Question · JavaScript and React course · Module 5: useEffect and Custom Hooks
Common useEffect Use Cases
Which of the following is NOT a typical use case for useEffect?
Answer options
- Setting up and clearing timers (setInterval, setTimeout)
- Fetching data from an external API after the component mounts
- Adding and removing event listeners on window
- Computing a value to display in JSX based on props
You can check the correct answer by solving this task in the CodeWorlds game.