react-is-dev
v1.0.5
Published
A simple library to determine whether a react app is under development or production environment
Downloads
839
Maintainers
Readme
Description
The library provides a single function to determine the environment under which a react app is started. The function returns true
in case of react development server, false
in case of built application.
Tested with create-react-app.
Installation
npm i react-is-dev
Import
import isDev from 'react-is-dev';
Usage
isDev
is a simple function returning Boolean
value and accepting your React
instance as a parameter.
So, to determine whether your app is under development or production enviroment, use:
import React from 'react';
...
import isDev from 'react-is-dev';
...
...
const ifDevEnv = isDev(React); // true if development mode, false if production