-
-
Save hex13/a7ab4dbefbefbc92e119f8ec0747a9e5 to your computer and use it in GitHub Desktop.
a.js
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
// hoc | |
compose( | |
withState({a: 'setA', b: 'setB'}), | |
withProps(({ a, b }) => ({ c: a + b })) | |
); | |
// render function | |
return ( | |
<div> | |
<WithState | |
config={{ | |
a: 'setA', b: 'setB' | |
}} | |
render={({a, b, setA, setB}) => ( | |
<WithProps | |
config={({ a, b }) => ({ c: a + b })} | |
render={({ c }) => ( | |
<div> | |
{c} | |
</div> | |
)} | |
/> | |
)} | |
/> | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment