Last active
April 30, 2018 20:31
-
-
Save vnglst/4a2212b4fbb4eb5607ba0e1eb746df56 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
// conditionally render children based on loading state | |
const AsyncPopup = ({ hasLoaded = false, children }) => ( | |
<View>{hasLoaded ? children : null}</View> | |
); | |
// example usage | |
const App = () => ( | |
<View> | |
<AsyncPopup hasLoaded> | |
<DataComponent data={someData} /> | |
</AsyncPopup> | |
</View> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment