While reviewing React hooks effects, a purchase request fires because state rendered. 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