import React from 'react'; import { Features } from './types'; export interface FeaturesContextValue { features: Features; } const FeaturesContextDefaultValue = {} as FeaturesContextValue; export const FeaturesContext = React.createContext(FeaturesContextDefaultValue); export interface WithFeaturesProps { features: Features; } export function withFeatures( Component: React.ComponentType ) { return class extends React.Component> { render() { return ( {(featuresContext) => ( )} ); } }; }