Skip to content

Instantly share code, notes, and snippets.

@benmvp
Last active September 25, 2017 21:23
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 benmvp/188b7da32b34f651145ea73b88f1fda1 to your computer and use it in GitHub Desktop.
Save benmvp/188b7da32b34f651145ea73b88f1fda1 to your computer and use it in GitHub Desktop.
Searching for a similar pattern for render props approach!
// 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