Last active
April 30, 2018 20:31
-
-
Save vnglst/cdff79e67cf57fc54a32577db9c7d28d 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
// AsyncPopup using renderProps | |
const AsyncPopupV2 ({ hasLoaded = false, renderContent }) => ( | |
<View>{hasLoaded ? renderContent() : null}</View> | |
); | |
// example usage: | |
const App = () => ( | |
<View> | |
<AsyncPopupV2 | |
hasLoaded | |
renderContent={() => <DataComponent data={someData} />} | |
/> | |
<AsyncPopupV2 renderContent={() => <DataComponent data={null} />} /> { /* no propTypes error here! */ } | |
</View> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment