Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

A is only ever to be used as the child of element"

import React from "react";
import { BrowserRouter, Routes, Route } from "react-router-dom";

const Page1 = () => {
  return <div>Page1</div>;
};
const Page2 = () => {
  return (
    <div>
      Page2<button>Click Me</button>
    </div>
  );
};
const App = () => {
  return (
    <div>
      <BrowserRouter>
        <Routes>
          <Route path="/" element={<Page1 />} />
          <Route path="/page2" element={<Page2 />} />
        </Routes>
      </BrowserRouter>
    </div>
  );
};
export default App;
 
PREVIOUS NEXT
Tagged: #A #child
ADD COMMENT
Topic
Name
7+6 =