Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// a simple feature toggle FaCC
const Toggle = () => {
const isToggledOn = checkToggle(this.props.toggleName)
return this.props.render(isToggledOn)
}
// and to use it
<Toggle
toggleName="featureAorB"
render={isToggledOn => isToggledOn ? <FeatureA /> : <FeatureB />}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment