The difference between these items of react-router

  1. what is the difference between react-router and react-router-dom?
  2. what is the difference between import {BrowserRouter as Router,Route,NavLink} from "react-router-dom";
    Router,Route,NavLink?
    1. Why do route and NavLink have to be in Router?
    2. See Link in some places and NavLink in other places
  3. < NavLink to= "/ b" > B < / NavLink >

  4. can I write this? Why
    var val ="/ home"
  5. < NavLink to= "{val}" > B < / NavLink >

  6. if not, how do I write this variable
Mar.14,2021

navLink is an encapsulation of link. In fact, you can write it yourself. Everything is in context.router, using history in context.router. The component wearing parameter is

  • < NavLink to= {val} > B < / NavLink >
  • , without quotation marks

    .
    Menu