简体   繁体   English

在 React 中制作弹出窗口 window 的最佳实践

[英]Best practice for making a popup window in React

In my React app, I want to create a popup window that renders a table with some data.在我的 React 应用程序中,我想创建一个弹出窗口 window 来呈现包含一些数据的表格。 However, I want to make it render in a separate browser window instance as opposed to a modal that is attached to the app's DOM.但是,我想让它在单独的浏览器 window 实例中呈现,而不是附加到应用程序 DOM 的模式。 Most of my research has led me to third party component libraries that just render an in-DOM modal just in different ways.我的大部分研究都将我引向了第三方组件库,它们只是以不同的方式呈现一个 in-DOM 模式。 What is the best way to create my desired effect, where clicking the "Open" button creates a new browser window instance that renders the table component?创建我想要的效果的最佳方法是什么,单击“打开”按钮会创建一个新的浏览器 window 实例来呈现表格组件?

Thanks谢谢

hmm.. maybe try the window.open() syntax嗯..也许试试 window.open() 语法

https://developer.mozilla.org/en-US/docs/Web/API/Window/openhttps://developer.mozilla.org/en-US/docs/Web/API/Window/open

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM