score:0

try it:


 <menu>
<lint to="/">
  <menubutton>
     home
   </menubutton>
 </lint >
   </menu>
   <menu>
      <link to="/about">
        <menubutton>
           about us 
        </menubutton>
      </link >
   </menu>

if your livestock router version is 6, you should do this:

import {
  browserrouter,
  routes,
  route,
} from "react-router-dom";

<browserrouter>
    <routes>
      <route path="/" element={<home/>}>
        <route path="/about" element={<aboutus/>}>
        </route>
      </route>
    </routes>
  </browserrouter>

score:0

try using the <link /> component on the <navbar /> component instead of <a> tags.

thus your code should look like

<menu>
    <link to="/home">
        <menubutton>
            home
        </menubutton>
    </link>
</menu>
<menu>
     <link to="/about">
         <menubutton>
              about us 
         </menubutton>
      </link>
</menu>

for more info about the <link /> component you can read through the react-router docs.


Related Query

More Query from same tag