4 ms·
You should be branching on the existence of `document` to discover if you are running in a DOM context, not `window`. Using `window` to branch SSR and CSR code
by lucacasonato 5y ago
You should be branching on the existence of `document` to discover if you are running in a DOM context, not `window`. Using `window` to branch SSR and CSR code will also inevitably will give false positives/negatives in workers and worklets when used in libraries.
- esprehn 5y agoWindow is not available in a worker context. What's a situation where you have a window available and no document?
- binarynate 5y agoDeno
- esprehn 5y agoThat would mean Deno is not following the web specs.