1. npm install react-router-dom

react-router

    • to
    • to
    • activeClassName
    • activeStyle
      • path
      • components
      • render
        • match
        • location
        • history
      • exact

        例子

        ```jsx import React from ‘react’ import { HashRouter as Router, Link, Switch, Route } from ‘react-router-dom’

import About from ‘./Views/About’ import Home from ‘./Views/Home’ import Users from ‘./Views/Users’

function App() { return (

{ console.log(props) // params: {id: “1”} return } }>
); }

export default App ```