Answers for "uselocation react use"

0

useLocation

// React Router v6: hook returns current location object
import { useLocation } from 'react-router-dom'

function App() {
  let location = useLocation()
  
  useEffect(() => {
    ga('send', 'pageview')
  }, [location])
  
  return (/*...*/)
}
Posted by: Guest on January-17-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language