首页 > 解决方案 > 如何在反应js中调用从一个组件到另一个组件的方法(在新选项卡中)

问题描述

在我的应用程序中,我们使用哈希路由器并使用 window.open 在新窗口中呈现 BillingManagement 组件,如下所示

winObj = window.open('#/BillingManagement');
        var that = this;
        winObj.onclick = function (event) {
            if (event.target.id === "someID") {
                that.currentWindowLogOut();
            }
        }

我想从 BillingManagement 窗口调用此组件的方法。当 BillingManagement 窗口未刷新时,它对我来说工作正常。如何从 Billingmanagement 窗口调用方法,反之亦然。

标签: reactjsweb-applicationscomponents

解决方案


推荐阅读