sub window 생성

<aside> 💡 button 클릭 시 윈도우를 연다고 가정 electron 11 기준

</aside>

  1. renderer 프로세스에서 remote 사용 가능하도록 변경

    // main.dev.ts
    
    webPreferences: {
    	...
      enableRemoteModule: true,
    },
    
  2. 클릭 콜백함수 정의 및 콜백 등록

    // App.tsx
    
    const handleMyCallback = async () => {
      const remote = require('electron').remote;
      const BrowserWindowa = remote.BrowserWindow;
      const win = new BrowserWindowa({
        height: 600,
        width: 800,
        webPreferences: {
          nodeIntegration: true,
        }
      });
      win.loadURL(`file://${__dirname}/index.html#/mymy`);
    }
    
    ...
    
    <button type="button" onClick={handleMyCallback}>
    
  3. Route에 path 옵션 다르게 해서 추가