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

194
Vistas
How to transfer data from the child window to the parent window?

I have two react components parent and child. I need to pass a token from a child component to a parent. The child component is opened with window.open from the parent component. I cannot get a reference to the parent component and pass data to it from the child.

function Parent() { 
return (
const SSOWindowOpen = () => {
const left = (screen.width - 465 ) / 2
const top = (screen.height - 650 ) / 4

const SSOWindow = window.open('/sso', 'SSOWindow',
'resizable=yes, width=' + 465
+ ', height=' + 650 + ', top='
+ top + ', left=' + left);)
}

child component

function children() {
return (
const Token = 123-token-123
window.opener ??????
)
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can declare a token variable in the parent window and from the child window you can assign it like:

`window.opener.variable_name=Token;`
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