@nc-react-hooks/use-prevent-leave (npm): Prompt the user for confirmation before leaving the page.
Keywords: react|hooks|preventLeave