uselocation react router hook code example
Example: useparams
import { useParams } from "@reach/router"
// route: /user/:userName
const User = () => {
const params = useParams();
return <h1>{params.userName}</h1>
)
import { useParams } from "@reach/router"
// route: /user/:userName
const User = () => {
const params = useParams();
return <h1>{params.userName}</h1>
)