Created
December 18, 2019 16:04
-
-
Save Andy-set-studio/61e5f92eaf4a6b3a1663daee8984ba7f to your computer and use it in GitHub Desktop.
Detect wether this is a browser context or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Returns true if we’re in a browser | |
const isBrowser = () => { | |
return typeof window !== 'undefined'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage: