UNPKG

@availity/hooks

Version:

A group of pre-built hooks that are common in most apps

18 lines (14 loc) 384 B
import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import avMessage from '@availity/message-core'; const useUpdateNav = () => { const location = useLocation(); useEffect(() => { try { avMessage.send({ event: 'navChange', url: window.location.href }); } catch { // noop } }, [location]); }; export default useUpdateNav;