Skip to content

Commit

Permalink
Update using-with-types.md (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wavum authored and James Baxley committed Oct 18, 2017
1 parent 4b5904b commit 55dc5d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion react-docs/source/using-with-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,16 @@ const withCharacter = graphql<Response, InputProps>(HERO_QUERY, {
})
});

export default class Character extends React.Component<ChildProps<InputProps, Response>, {}> {
class Character extends React.Component<ChildProps<InputProps, Response>, {}> {
render(){
const { loading, hero, error } = this.props.data;
if (loading) return <div>Loading</div>;
if (error) return <h1>ERROR</h1>;
return ...// actual component with data;
}
}

export default withCharacter(Character);
```

<h2 id="using-name">using the `name` property</h2>
Expand Down

0 comments on commit 55dc5d3

Please sign in to comment.