Check out example codes for "electron driver window maximize selenium webdriver". It will help you in understanding the concepts better.

Code Example 1

JavascriptExecutor js = (JavascriptExecutor) driver;  
js.executeScript("require('electron').remote.BrowserWindow.getFocusedWindow().maximize();");

Learn ReactJs, React Native from akashmittal.com