Feature toggle framework for react - down with feature branches
npm install react-feature-toggles

npm install --save react-feature-toggles
Wrap your app in the FeatureToggleProvider and pass in a list of toggles, then use the FeatureToggle component throughout your application.
Both `` const toggleNames = { const toggles = { const ExampleComponent = () => ( Hello World Sorry, toggle is off ReactDOM.render( To use with redux you may want to do something like: ` const ConnectedFeatureToggleProvider = connect(mapStateToProps)(FeatureToggleProvider); And then use the connected provider in place of the normal provider. - Clone this repoFeatureToggleProvider and FeatureToggle must have only one child, this is so that the library isn't rendering additional elements on your behalf and making assumptions about your needs e.g you may want an rather than a .javascript
import React from 'react';
import ReactDOM from 'react-dom';
import { FeatureToggleProvider, FeatureToggle } from '../lib/index';
SHOW_HELLO_WORLD: 'showHelloWorld'
// ... add more here
};
// Try setting this to true
[toggleNames.SHOW_HELLO_WORLD]: false
// ... add more here
};
Toggling Example
);
`$3
const mapStateToProps = state => ({
featureToggleList: state.features,
});
`Building the example
- Run npm installnpm run build-example
- Run example/example.html
- Open in the browser
- Play around with the toggle valuesMaking a pull request?
- Make sure you've run npm run ci-build` firstChanges
- Version 3.0.3 Update dev dependencies
- Version 3.0.2 Update readme
- Version 3.0.1 Remove self dependency (:/)
- Version 3.0.0 Upgrade peer deps (and internal deps) for React 16
- Version 2.0.3 Switch proptypes from React.PropTypes to the dedicated proptypes library
- Version 2.0.2 Ensures an undefined toggle is treated a false
- Version 2.0.1 Removes a containing div around the provider children, should you need this div, please add it in yourself.