Module

useEnvironmentCheck

Custom hook for providing the environment value for the current app context.

The hook doesn't take any parameters and returns a set of booleans representing which environment state we are in.

The hook checks the process.env.NODE_ENV value to determine what the current environment is.

Currently only two environments are supported: prod and dev

Hook Usage

Checking the current environment

const {dev, prod} = useEnvironmentCheck()

...

if (dev) console.log("we are in dev mode")

IMPORTANT NOTE

The environment refers to Node's build environment, not JCU's app environment. This means that things on apps-test.jcu.edu.au are PRODUCTION when using this hook, because they are built and deployed using the production flag in node.

View Source tools/hooks/useEnvironmentCheck.ts, line 3