react-use-focus-exit

Use this hook when you want to listen for when focus exits a specific container.