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

144
Vistas
Saving parts of URL information for reuse in React

How can one take the information of a URL?

I want to use the appended information on this URL http://localhost:3000/transaction?transactionId=72U8ALPE in a fetch API.

I am trying to take the value 72U8ALPE and save it to state or as a variable. Then use if on the URL I will use on a fetch request. For example

https://google.com/${the-url-last-part-saved-as-variable-or-in-state}

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

0

You can get the query parameters from the URL object. This could look something like this:

let currentUrl = new URL(window.location);
let transactionId = currentUrl.searchParams.get('transactionId');

You can then use the variable to append to your HTTP request.

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