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

167
Vistas
What is the Simple way to use URL params in react-router V6

I am learning to react and the tutorial was way too old so I switched to documentation and articles. But I found it very confusing. (Eg: Switch was removed in V6 But still there in V6 docs).

How to use URL params to render a param to an element? like a heading?

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

you can use this let {id} = useParams(); for a route with a following path path="/manage-business/:id"

about 4 years ago · Juan Pablo Isaza Denunciar

0

Adding to Michal Šajdík ans

export function Some() {
    let { name } = useParams(); 
    return (
        <div>
        <p>All details about {name}</p>
        </div>
    )
}

and in your App.js

function App() {
  return (
    <Router>
          <Routes>
            <Route path="link/:name" element={<Some/>} />
          </Routes>
    </Router>
  );
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

  1. Make sure you install react router dom

    npm install react-router-dom

  2. import react router

    import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';

  3. Wrap your components in the Router and Routes imports. This is a must for v6.

        <Router>
        <Routes>
            <Route
                exact
                path="/any-name"
                element={(<componentNameToShow />)}
            />                                           
        </Routes>                                        
        </Router>
    
about 4 years ago · Juan Pablo Isaza Denunciar
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