electron/electron-quick-start-typescript

Type 'null' is not assignable to type 'BrowserWindow'.

andrewrynhard opened this issue · 2 comments

$ tsc
main.ts:27:5 - error TS2322: Type 'null' is not assignable to type 'BrowserWindow'.

27     mainWindow = null
       ~~~~~~~~~~


Found 1 error.
let mainWindow: Electron.BrowserWindow;

I think this should be handled with mainWindow.destroy() or with a (hypothetically) purge() method instead of a null assignment... With this electron logic, the example code seems to not make sense :/