Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #141 from jamesplease/update-examples
Browse files Browse the repository at this point in the history
Update examples to always check for data
  • Loading branch information
jamesplease committed Mar 16, 2018
2 parents 0ecefd5 + 13c57a9 commit 042a79a
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ class App extends Component {
return <div>The request did not succeed.</div>;
}

return (
<div>
<div>Post ID: {data.id}</div>
<div>Post Title: {data.title}</div>
</div>
);
if (data) {
return (
<div>
<div>Post ID: {data.id}</div>
<div>Post Title: {data.title}</div>
</div>
);
}

return null;
}}
</Fetch>
);
Expand Down Expand Up @@ -350,7 +354,11 @@ about the response, such as its status code.
};
}}>
{({ data }) => {
<div>{data.countryName}</div>;
if (data) {
return <div>{data.countryName}</div>;
}

return null;
}}
</Fetch>
```
Expand All @@ -371,7 +379,11 @@ about the response, such as its status code.
};
}}>
{({ data }) => {
<div>{data.countryName}</div>;
if (data) {
return <div>{data.countryName}</div>;
}

return null;
}}
</Fetch>
```
Expand Down

0 comments on commit 042a79a

Please sign in to comment.