Skip to content

Instantly share code, notes, and snippets.

@jbaxleyiii
Last active March 21, 2018 15:25
Show Gist options
  • Select an option

  • Save jbaxleyiii/699da353d6b66def97da1144af57ba7f to your computer and use it in GitHub Desktop.

Select an option

Save jbaxleyiii/699da353d6b66def97da1144af57ba7f to your computer and use it in GitHub Desktop.
const Feed = () => (
<View style={styles.container}>
<Header />
<Query query={GET_DOGS}>
{({ loading, error, data, client }) => {
if (loading) return <Fetching />;
if (error) return <Error />;
return (
<DogList
data={data.dogs}
renderRow={(type, data) => (
<Query
query={GET_DOG}
variables={{ breed: data.breed }}
skip={true}
>
{({ requestQuery }) => (
<Link
to={{
pathname: `/${data.breed}/${data.id}`,
state: { id: data.id }
}}
onMouseOver={requestQuery}
style={{ textDecoration: "none" }}
>
<Dog {...data} url={data.displayImage} />
</Link>
)}
</Query>
)}
/>
);
}}
</Query>
</View>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment