“Tautan Bereaksi Router Dom” Kode Jawaban

Tautan Bereaksi Router Dom

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

Tag tautan bereaksi

<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

React Router Link

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

const customHistory = createBrowserHistory();

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

Jawaban yang mirip dengan “Tautan Bereaksi Router Dom”

Pertanyaan yang mirip dengan “Tautan Bereaksi Router Dom”

Lebih banyak jawaban terkait untuk “Tautan Bereaksi Router Dom” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya