Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Feature Request: Render Props Implementation #1570

Closed
@kedarguy

Description

@kedarguy

After reading Michael Jackson's great article: (https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce), and building a few Components following this pattern myself I was wondering its possible to implement the apollo HOC with the Render Props pattern.

The Article does a better job than I can explaining the benefits over an HOC.

Did anyone look into this? couldn't find any discussions about it

It would look something like this:

<Apollo 

 queries= {{...}}
  
 mutations={{...}}  

 ...{all other optional arguments passed as props to the Apollo Component}  

 render={ data => {

if (data.loading) return <div> Loading... </div>
if(data.data) return <div> data.data... </div>
if (data.error) return <div> Error </div>

}  }  
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions