Skip to content

This tool allows you to install a custom dev-tools on your React application.

Notifications You must be signed in to change notification settings

sdivelbiss/devt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://img.shields.io/npm/v/devt?style=for-the-badge

devt

This tool allows you to install a custom dev-tools on your React application.

devt will be enabled by default when process.env.NODE_ENV is either 'dev', 'develop', or 'development'.

Install

npm install --save-dev devt

Setup

In your index file, import loadDevTools and wrap your initial render with the loadDevTools function. The second argument to the loadDevTools function is an array of feature flags.

import  React from  'react';
import { render } from  'react-dom';
import { loadDevTools } from 'devt';

loadDevTools(() => {
	render (<App/>,document.querySelector('#app'))
}, ["catFeature"])
parameters type required desc
callback function Yes render(, document.querySelector('#app'))
features array Yes Array of feature flags ["catFeature", "coolFeature", ...]
Each item in the features array create a toggle to enable/disable the feature.

devt

Usage

import { featureToggles } from  'devt';

...
<div>
	{featureToggles.catFeature ? "show cats" : "hide cats"}
</div>
...

About

This tool allows you to install a custom dev-tools on your React application.

Resources

Stars

Watchers

Forks

Packages

No packages published