Shane Callanan
Shane Callanan

Reputation: 521

How to open route in a new tab using MobX State Router's RouterStore?

https://nareshbhatia.github.io/mobx-state-router/docs/api-router-store

Looking through their docs, I don't see any mention of how to open a route in a new tab. Does this mean that I must resort to javascript's window.open() API?

Upvotes: 2

Views: 283

Answers (1)

Tholle
Tholle

Reputation: 112877

Opening up a new tab will unavoidably create a new history stack, so it doesn't matter how you go about opening it.

You could use window.open() like you alluded to, or even an a tag with an attribute target set to _blank:

<a target="_blank" href="/a-route">Open a route in a new tab</a>

Upvotes: 1

Related Questions