import { connect } from 'react-redux'; import { isFeatureEnabled } from './reducers' function EnabledFeature({ isEnabled, children }) { if (isEnabled) { return children; } return null; } export default connect((store, { name }) => { isEnabled: isFeatureEnabled(store, name) })(EnabledFeature);