Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

573
Vistas
Type '{ children: Element[]; }' is missing the following properties from type 'RouterProps': location, navigator

Trying to use React Router V6 with typescript, however im getting a type error on the <Router /> component when adding Routes within. It says that the children property being passed to the Router is not of the correct type, yet I've simply used the components the library has given.

My code:

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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda