“react-router-dom” Réponses codées

react-router-dom

$ npm install --save react-router-dom
Enthusiastic Elephant

react-router-dom

npm install react-router-dom
Roseat Flamingo

react-router-dom

npm install react-router-dom
Upset Unicorn

react-router-dom

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

function Locaions() {

  let location = useLocation();

  return (
    <>
    {location.pathname === "/Home" ?
    "Hi i am at the homepage"
    :
    "d-none"
    }
    </>
  );
}
Didi Abel

react-router-dom

npm i @types/react-router-dom
Enchanting Elephant

react-router-dom

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";

ReactDOM.render(
  <BrowserRouter>
    <App />
  </BrowserRouter>,
  document.getElementById("root")
);
Aggressive Alpaca

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code