[英]How can I embed new React JS Front-end in my existing monolithic Node JS App?
[英]How to open a new tab from a react front-end app
好的,我想做的是创建一个允许用户发布推文的 twitter 前端应用程序。 The problem I'm having is during the 3-legged Auth sequence, I get a response from the twitter api in form of a html and I need to open that response data in a new window so the user can accept whatever it is and allow我的应用程序来访问他们的帐户。 有人可以指出我正确的方向。 我不想建立一个后端来解决这个问题,因为我试图保持它是一个单独的反应应用程序。
谢谢
通过将目标设置为 _blank,您可以使用 window.open 在新的 window 中打开。 此外,它将返回一个弹出实例,因此您可以将其存储在 state 中,并随时关闭它。
const popup = window.open(twitterUrl, '_blank', 'width: 580px, height: 690px'); popup.close() // when you need it
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.