/

SSR

react

Use this to check if window is defined

js
const windowGlobal = typeof window !== 'undefined' && window

Useful libraries when working with SSR:

  • github.com/react-co...se-where
Edit this page
Want to make your own site like this?
Try gatsby-theme-code-notes by Zander Martineau.
Notes on code. My second brain, by Zander Martineau.