📜  如何使用 React 路由器 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:03.195000             🧑  作者: Mango

代码示例2
React router as a browserRouter in App.js for navbar links like Home,
services,conatct-us etc.
   // npm install react-router-dom

// ##### Basic Routing #####
import React from 'react';
import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';

export default function App() {
   return (
      
         
{/* A looks through its children s and renders the first one that matches the current URL. */}
); } function Home() { return

Home

; } function About() { return

About

; } function Users() { return

Users

; }