Skip to content

Instantly share code, notes, and snippets.

@mjackson
Created October 7, 2017 23:41
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 mjackson/2e2134ea5a94815c1032330a9376d35c to your computer and use it in GitHub Desktop.
Save mjackson/2e2134ea5a94815c1032330a9376d35c to your computer and use it in GitHub Desktop.
import React from 'react'
function Navigation({ render }) {
// Call render() first to get the children. You can pass
// whatever state you need here so they know how to render.
let children = render()
children = React.Children.map(children, child => (
React.cloneElement(child, {
// put whatever additional props you need here!
})
))
// ...
}
// Does that make sense?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment