Skip to content

Instantly share code, notes, and snippets.

@jbaxleyiii
Created June 4, 2017 03:46
Show Gist options
  • Save jbaxleyiii/32515d2ed68c1171936bd2772dfe3db7 to your computer and use it in GitHub Desktop.
Save jbaxleyiii/32515d2ed68c1171936bd2772dfe3db7 to your computer and use it in GitHub Desktop.
render-error
export default withCharacter(({ loading, hero, error }) => {
// $ExpectError [number] this type cannot be compared to boolean
if (loading > 1) return <div>Loading</div>;
if (error) return <h1>error.name</h1>;
return ...;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment