skip to Main Content

enter image description hereI have completely installed my react router and my project is build completely but the only issue is that when I imported this

import {
  BrowserRouter as Router,
  Switch,
  Route,
  Link
} from "react-router-dom";

Import in App.js
enter image description here

Import in Navbar.js
enter image description here

the Link is in light color in vs code compared to others that means that means it is not imported and thus I cannot replace anchor tag and href with Link to="".
Anyone can please help with the solution because without these I cannot continue further.

2

Answers


  1. Close the Link tag in Navbar.js

    in line 9 of Navbar.js

    <Link className="navbar-brand" to="/"><Link>
    

    and in line 16 of Navbar.js

    <Link className="nav-link active" aria-current="page to="/"><Link>
    
    Login or Signup to reply.
  2. The Link module imported in App.js is not yet used
    that’s why it is in light color.

    ProTip: If you are not using Link module in App.js, just remove the import

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search