install the router

 =

npm i -D react-router-dom

import ReactDOM from "react-dom/client";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Layout from "./Car";


export default function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Layout />}>
         
        </Route>
      </Routes>
    </BrowserRouter>
  );
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);

=

No comments:

Post a Comment

How to host application on server new way

 copy the htacess from public to root copy the server.php from public to root but rename to index.php htacess <IfModule mod_rewrite.c>...