Skip to content

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Fun With flags

OBS! This library is still under development and may change it's api without warning. Use at your own risk.

Installation

npm install react-fun-with-flags

or

npm install react-fun-with-flags

Usage

Add the FlagProvider to your App.

import React from 'react';
import { FlagProvider } from 'react-fun-with-flags';

const flags = {
	fun: true,
	with: true,
	trains: false
}
<FlagProvider flags={flags}>
  {...}
</FlagProvider>

Then toggle your components with the help of the Flag, FlagEnabled, FlagDisabled components.

Example:

import React from 'react';
import { FlagEnabled } from 'react-fun-with-flags';


const MyComponent = ({}) => (
  <div>
    <span>Hello</span>
    <FlagEnabled name="fun">
      <span>World</span>
    </FlagEnabled>
  </div>
);

export default MyComponent;

About

React feature flags/toggles

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages