Skip to content

Instantly share code, notes, and snippets.

@jgierer12
Created December 4, 2017 20:28
Show Gist options
  • Save jgierer12/7dc3420fa774ed96ce8fc48ddd6c824c to your computer and use it in GitHub Desktop.
Save jgierer12/7dc3420fa774ed96ce8fc48ddd6c824c to your computer and use it in GitHub Desktop.
const View = ({ loading, error, ...otherProps }) => (
<div>
{(() => {
if (loading) {
return <Loading />
} else if (error) {
return <Error error={error} />
} else {
return <MyLoadedComponent {...otherProps} />
};
})()}
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment