Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (flagName: FlagName, propKey?: string) => (
Component: React.ComponentType
): React.ComponentType =>
flowRight(
setDisplayName(wrapDisplayName(Component, 'injectFeatureToggle')),
withFlags(),
// @ts-ignore
injectFeatureToggle(flagName, propKey)
)(Component);
export default (flagName: FlagName, propKey?: string) => (
Component: React.ComponentType
): React.ComponentType =>
flowRight(
setDisplayName(wrapDisplayName(Component, 'injectFeatureToggle')),
// @ts-ignore
connect(mapStateToProps),
injectFeatureToggle(flagName, propKey)
)(Component);
) => (WrappedComponent: ComponentType<$Diff>) =>
flowRight(
setDisplayName(wrapDisplayName(WrappedComponent, 'injectFeatureToggle')),
withFlags(),
injectFeatureToggle(flagName, propKey)
)(WrappedComponent);