Is it possible to detect whether the current version of React is development or production at runtime? I\'d like to do something like this:
if (React.isDevelopme
I use a helper file (in Typescript):
import process from "process";
const development: boolean = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
export default function isDev(): boolean
{
return development;
}
Then elsewhere I use it like this:
import isDev from "./helpers/DevDetect";
if (isDev())
{
...
}