Estoy trabajando en una aplicación en Electron y ReactJS. Necesito crear un nuevo BrowserWindow desde el componente de reacción, pero esto no funciona, y la nueva ventana en la consola tiene el error @electron/remote is disabled for this WebContents. Call require("@electron/remote/main").enable(webContents) to enable it.
Principal.js
const mainWindow = new BrowserWindow({ width: 1280, height: 720, show: false, webPreferences: { nodeIntegration: true, enableRemoteModule: true, contextIsolation: false, webSecurity: false }, }) require("@electron/remote/main").initialize(); require("@electron/remote/main").enable(mainWindow.webContents);Reaccionar componente
function createWindow () { let win = new BrowserWindow({ webPreferences: { nodeIntegration: true, contextIsolation: false, webSecurity: false }, }) window.require("@electron/remote/main").enable(win.webContents); win.loadURL('http://localhost:3000/overlay') } createWindow()¿Cómo puedo crear una nueva ventana del navegador?