1.0.9 • Published 8 years ago

react-features v1.0.9

Weekly downloads
16
License
-
Repository
-
Last release
8 years ago

react-features

bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies bitHound Code Travis CI Build

Get Started

This package is available on npm as react-features.

Example Usage

1: Declare your feature configuration:

var featureConfig = {
    hello: true,
    worlds: 5
};

2: Inject your config in to the feature container, and render your features

<FeatureContainer features={featureConfig}>
    <Feature featureKey='hello'>
        <h1>
            Hello,
        </h1>
    </Feature>
    <Feature featureKey="worlds">
        <WorldComponent />
    </Feature>
</FeatureContainer>

3: Consume your feature config in a component as props

class WorldComponent extends React.Component {
    render() {
        return <div>
            {this.props.worlds} worlds
        </div>;
    }
}

Demo

You can view the demo running in webpack-dev-server to see the components in action.

npm start
open http://localhost:8080/public