Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

574
Views
Escriba '{ niños: Elemento[]; }' faltan las siguientes propiedades del tipo 'RouterProps': ubicación, navegador

Intento usar React Router V6 con mecanografiado, sin embargo, obtengo un error de tipo en el componente <Router /> al agregar rutas dentro. Dice que la propiedad de los niños que se pasa al enrutador no es del tipo correcto, sin embargo, simplemente usé los componentes que me dio la biblioteca.

Mi código:

 import React from 'react'; import ReactDOM from 'react-dom/client'; import { BrowserRouter, Router, Route } from 'react-router-dom'; // Styles import './css/index.css'; // Pages Directory import * as Pages from './pages'; const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); root.render( <React.StrictMode> <BrowserRouter> <Router> <Route path="/" element={<Pages.Home />} /> <Route path="about" element={<Pages.About />} /> </Router> </BrowserRouter> </React.StrictMode> );

Error:

 ERROR in src/index.tsx:18:5 TS2739: Type '{ children: Element[]; }' is missing the following properties from type 'RouterProps': location, navigator 16 | <React.StrictMode> 17 | <BrowserRouter> > 18 | <Router> | ^^^^^^ 19 | <Route path="/" element={<Pages.Home />} /> 20 | <Route path="about" element={<Pages.About />} /> 21 | </Router>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!