Created
December 4, 2017 20:28
-
-
Save jgierer12/7dc3420fa774ed96ce8fc48ddd6c824c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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