question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing object to a new tab/window using <Link ... target="_blank">

See original GitHub issue

I’m using redux, and react-router.

When I need to route and pass data to next component, I used <Link query={{ id : 'hint' }} ... >.

So next component can get hints from this.props.location.query, and use it to intended data from redux (subscribed) store.

But I need to change that link to new window, so I used <Link ... target="_blank">.

New window is opened and new component is loaded successfully, but the store of new window has empty(new) state. So I cannot find intended data from this store.

I was able to implement same functionality at my other jquery project, using window.opener, with global variable, like window.opener.getData()

Is there any way to access parent’s store/state?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
s3ungw00ncommented, Sep 20, 2016

@SubhuMS When you open the new window using window.open, you will get the instance of it. You can send postMessage to it, and you will be able to send/receive state between windows.

I created and wrapped my whole element with <Popout> and <PoppedOut>, which send or receive state when popped out.

I hope it helps you, Please tell me you need a gist for this codes.

6reactions
Kannajcommented, Sep 27, 2016

@mazicky - Would you mind posting a gist? I still am a bit unclear over how you managed to di it.

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing object to a new tab/window using <Link ... - GitHub
I'm using redux, and react-router. When I need to route and pass data to next component, I used . So next component can...
Read more >
reactjs - Pass state via Link while redirected to a new tab
I think this is not possible with Link state. Cause if you leave the page your memory will be clean. You might want...
Read more >
Don't Use The Target="_Blank" Link Attribute In These Cases
Using the _blank link attribute will cause the link to open in a new browser window or tab. But it is not as...
Read more >
How to Open a Link in a New Tab – HTML target blank ...
You can use the target="_blank" attribute if you want your users to click on a link that opens up a new browser tab....
Read more >
How to fix target=”_blank” links: a security and performance ...
As a side-project, I developed a personal “start page” which looks and behaves similar to Opera's Speed Dial. When clicking one of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found