1.0.5 • Published 3 years ago

react-is-dev v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Build Status Coverage Status

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
1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago