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

192
Vistas
How to determine if the url parameter is optional. React Router Dom version 5.1.7

React-router-dom library version 4 and 5 has an optional URL parameter marked by a question mark e.g. /:required/:optional?.

My question is - Is there a way to determine whether the current URL parameters are optional or not using react-router-dom API?

Unfortunately, useParams() doesn't differentiate parameters, but just gives a list of them. I can imagine it can be checked using match() and RegExp, but I was wondering if there is a more concise option inside react-router-dom itself, considering that ? modifier is removed in version 6 and match + RegExp combination will not work on upgrade.

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