While reviewing React hooks effects, several forms repeat online-status logic. Which action best addresses the problem?
Answer options
- A. Include the room identifier dependency
- B. Return a listener cleanup function
- C. Send the request from the click handler
- D. Extract the logic into a custom hook