Last active
September 25, 2017 21:23
-
-
Save benmvp/188b7da32b34f651145ea73b88f1fda1 to your computer and use it in GitHub Desktop.
Searching for a similar pattern for render props approach!
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
// This is what gets tested because it doesn't rely on any of | |
// the *magic* that may be in `withFoo` like reading context. | |
// The test just needs to pass in a valid `foo` prop which would've | |
// come from `withFoo`. | |
export const MyComponent = ({foo}) => ( | |
<div>{foo}</div> | |
) | |
// This what actually gets used in the app! | |
export default withFoo(MyComponent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment