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 wanted access to this from the index.html and desired a solution which didn't involve ejecting webpack or configuring it with additional modules and I came up with this.
Sources are David's answer above and the create-react-app documentation for using environment variables in the html file
if ( ! '%NODE_ENV%' || '%NODE_ENV%' === 'development') {
// dev code
} else {
// production code
}