“Link React Router Dom” Respostas de código

Link React Router Dom

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

Link Tag 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

Link do roteador de reação

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

const customHistory = createBrowserHistory();

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

Respostas semelhantes a “Link React Router Dom”

Perguntas semelhantes a “Link React Router Dom”

Mais respostas relacionadas para “Link React Router Dom” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código