import * as React from "react"; import { Consumer, ContextValue } from "@oursky/react-messageformat"; import hoistNonReactStatic from "hoist-non-react-statics"; export interface IntlProps { intl: ContextValue; } function _injectIntl(Component: React.ComponentType) { const ComponentWithIntl: React.SFC = props => { // tslint:disable-next-line:oursky-no-inline-function-children return {intl => }; }; return ComponentWithIntl; } export function injectIntl( Component: React.ComponentType ) { const WrappedComponent = _injectIntl(Component); hoistNonReactStatic(WrappedComponent, Component); return WrappedComponent; }