Skip to content

Instantly share code, notes, and snippets.

@vnglst
Last active April 30, 2018 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vnglst/4a2212b4fbb4eb5607ba0e1eb746df56 to your computer and use it in GitHub Desktop.
Save vnglst/4a2212b4fbb4eb5607ba0e1eb746df56 to your computer and use it in GitHub Desktop.
// 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