isSSR

isSSR is a utility to distingush between server environment and client environment.

Import#

import { isSSR } from '@dwarvesf/react-utils'

Return value#

This method returns true if the function is invoked in a browser and returns false if it is invoked in a server.

Usage#

if (isSSR()) {
/// do something
}
Edit this page

Made with ❤️ by Dwarves Foundation