Passing object to a new tab/window using <Link ... target="_blank">
See original GitHub issueI’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:
- Created 8 years ago
- Reactions:1
- Comments:12 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@SubhuMS When you open the new window using
window.open
, you will get the instance of it. You can sendpostMessage
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.
@mazicky - Would you mind posting a gist? I still am a bit unclear over how you managed to di it.
Thanks.