Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!