“Link React Router Dom” Réponses codées

Link React Router Dom

<Link
  to={{
    pathname: "/courses",
    search: "?sort=name",
    hash: "#https://api.alat.ng/RegistrationApi/index.html",
    state: { fromDashboard: true }
  }}
/>
Ashamed Ant

TAG TAGNE REACT

<Link to={`/users/${user.id}`} activeClassName="active">{user.name}</Link>
// becomes one of these depending on your History and if the route is
// active
<a href="/users/123" class="active">Michael</a>
<a href="#/users/123">Michael</a>

// change the activeClassName
<Link to={`/users/${user.id}`} activeClassName="current">{user.name}</Link>

// change style when link is active
<Link to="/users" style={{color: 'white'}} activeStyle={{color: 'red'}}>Users</Link>
2 Programmers 1 Bug

lien de routeur react

import React from "react";
import ReactDOM from "react-dom";
import { createBrowserHistory } from "history";

const customHistory = createBrowserHistory();

ReactDOM.render(<Router history={customHistory} />, node);
Sagheer Syed

Réponses similaires à “Link React Router Dom”

Questions similaires à “Link React Router Dom”

Plus de réponses similaires à “Link React Router Dom” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code