I'm making few practica but when I loaded the router into my new "project" in react-router-dom v6 the screen turns white like I compile the router wrong.
import React from "react";
import ReactDom from "react-dom";
import {BrowserRouter, Route, Routes } from "react-router-dom";
import { about } from ".//views/about.js"
export default function App() {
return (
<BrowserRouter>
<Routes>
<Route exact path="/about" element={<about />} />
<Route path="/inicio" element={<home />} />
</Routes>
</BrowserRouter>
);
}
This is my about.js
import React from 'react'
export default function about() {
return <div>Soy una pagina de practica</div>
}
In other forum, I've told that use the <Switch> method, but I used react-router-dom v6 and need to use <Routes>. So if anyone can help I'd be grateful because I tried everything nothing seems to work me.