Last active
November 25, 2018 04:33
-
-
Save kilgarenone/97b00a1808caeb5641543532625494a8 to your computer and use it in GitHub Desktop.
consume render props
This file contains hidden or 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
// destructure the object given when called in the <Hello />, | |
// then pass those properties to our <CustomComponent /> to be consumed. | |
// The 'isSubmitting' value will be toggled and consumed accordingly too! | |
<Hello> | |
{({ | |
handleThisClick, | |
handleFormSubmit, | |
isSubmitting | |
}) => ( | |
<CustomComponent | |
handleThisClick={handleThisClick} | |
handleFormSubmit={handleFormSubmit} | |
isSubmitting={isSubmitting} | |
/> | |
)} | |
</Hello> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment