title: How to use contextBridge in React-Electron?
body: <p>I'm trying to connect with preload and frame.tsx<br />
  But, It isn't working.</p>
  <p>frame.tsx</p>
  <pre><code>function handleButtonClick(id: string) {
      window.electron.send(&quot;requestWindowChange&quot;, &quot;data&quot;) // Error part
      if(id === 'maximize') {
          setIsMaximize(!isMaximize)
      }
  }
  </code></pre>
  <p>I simply add it. and...</p>
  <p>preload.ts</p>
  <pre><code>import {contextBridge, ipcRenderer} from 'electron'
  
  contextBridge.exposeInMainWorld('electron', {
      send: (channel:string, data) =&gt; {
          let normalChannels = ['requestWindowChange']
          if (normalChannels.includes(channel)) {
              ipcRenderer.send(channel, data)
          }
      },
      receive: (channel:string, func) =&gt; {
          let normalChannels = ['responseWindowChange']
          if (normalChannels.includes(channel)) {
              ipcRenderer.on(channel, (_event, data) =&gt; func(data))
          }
      }
  })
  </code></pre>
  <p>Also, I'm already making 'preload.ts' to 'preload.js' by using 'tsc' command.</p>
  <p>Finally, here is the electron.ts</p>
  <pre><code>mainWindow = new BrowserWindow({
      height: 720,
      width: 1280,
      minHeight: 300,
      minWidth: 450,
      frame: false,
      show: false,
      center: true,
      fullscreen: false,
      kiosk: !isDev,
      resizable: true,
      webPreferences: {
          preload: path.join(__dirname, &quot;preload.js&quot;)
      }
  })
  </code></pre>
  <p>I only copy necessary part.<br />
  If you need more code, please comment here.<br />
  I really don't know why It isn't working.</p>
  <ul>
  <li>Here is Error Message.</li>
  </ul>
  <blockquote>
  <p>any Property 'electron' does not exist on type 'Window &amp; typeof
  globalThis'. Did you mean 'Electron'?ts(2551)</p>
  </blockquote>