“React Route Path Exact” Respostas de código

React Get Route Path

import { useLocation } from 'react-router-dom'

function HeaderView() {
  const location = useLocation();
  console.log(location.pathname);
  return <span>Path : {location.pathname}</span>
}

Strange Seahorse

React Route Path Exact


<Route exact path="/">
  <Home />
</Route>

# The exact prop above tells the Router component to match the path exactly. If you don't add the exact prop on the / path, it will match with all the routes starting with a / including /about.
Irfan

Respostas semelhantes a “React Route Path Exact”

Perguntas semelhantes a “React Route Path Exact”

Mais respostas relacionadas para “React Route Path Exact” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código