Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react router dom v6 syntax

import './App.css';
import { Routes, Route } from "react-router-dom";

import {BrowserRouter} from 'react-router-dom'

function App() {
  return (
    < >
<BrowserRouter>   
    <Naavbar/>

    <NoteState>
  <Routes>
      <Route path="/" element={<Home />}/>
        <Route exact path="/about" element={<About />} />
      
    </Routes>

    </NoteState>
    </BrowserRouter>

  </>
  );
}

export default App;
 



 
PREVIOUS NEXT
Tagged: #react #router #dom #syntax
ADD COMMENT
Topic
Name
8+2 =