Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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.
 
PREVIOUS NEXT
Tagged: #React #route #path #exact
ADD COMMENT
Topic
Name
5+1 =