Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react-router-dom useLocation

import { useLocation } from "react-router-dom";

function Locaions() {

  let location = useLocation();

  return (
    <>
    {location.pathname === "/Home" ?
    "Hi i am at the homepage"
    :
    "d-none"
    }
    </>
  );
}
 
PREVIOUS NEXT
Tagged: #useLocation
ADD COMMENT
Topic
Name
4+8 =