While reviewing React hooks effects, several forms repeat online-status logic. Which action fixes it, and which check proves it worked?
Answer options
- A. Verify each caller owns its hook state
- B. Include the room identifier dependency
- C. Return a listener cleanup function
- D. Extract the logic into a custom hook