Implement useOutsideClick()
Detect events outside a referenced element, clean up listeners and handle nested interactive elements.
Implementation Requirements & Edge Cases
- Detect events outside a referenced element, clean up listeners and handle nested interactive elements.
Interview Evaluation Criteria
- Clarify constraints, API shape, error handling, and asynchronous edge cases upfront.
- Verify keyboard accessibility, clean state modeling, and zero memory/timer leaks where applicable.
- Discuss time/space tradeoffs and write test cases covering empty, invalid, and boundary inputs.
Module Context & References
React · Custom hooks Effects, stale closures, cleanup and reusable behavior
Personal Notes · Markdown