Question · JavaScript and React course · Module 5: useEffect and Custom Hooks

Effect Cleanup Strategies

Which of the following resources requires a cleanup function in useEffect?

Answer options

  • Reading a value from state
  • Rendering JSX
  • WebSocket subscriptions and event listeners
  • Passing props to a child component

You can check the correct answer by solving this task in the CodeWorlds game.