React hook that detects if an element is outside of its parent’s bounds on any of its sides (like collision detection)