import React from "react" ; import { compose , hoistStatics , InferableComponentEnhancer , wrapDisplayName , } from "recompose" ; import { Environment } from "relay-runtime" ; import { CoralContext , withContext } from "../bootstrap" ; deprecated function createFetchContainer < T extends string , V , R > ( propName , fetch ) { return compose ( withContext ( ( context ) => ( { context } ) ) , hoistStatics ( ( BaseComponent ) => { class CreateFetchContainer extends React . Component < any > { public static displayName = wrapDisplayName ( BaseComponent , "createFetchContainer" ) ; private fetch = ( variables ) => { return fetch ( this . props . context . relayEnvironment , variables , this . props . context ) ; } ; public render ( ) { const { context : _ , ... rest } = this . props ; const inject = { [ propName ] : this . fetch , } ; return < BaseComponent { ... rest } { ... inject } />; } } return CreateFetchContainer as React . ComponentClass < any > ; } ) ) as any ; } export default createFetchContainer ;