// 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