Last active
June 5, 2018 14:21
-
-
Save developit/5d879edb820228224dc9 to your computer and use it in GitHub Desktop.
This file contains 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
// - yes, this is the entire implementation | |
// - no, it doesn't actually depend on preact | |
export class Provider { | |
getChildContext () { | |
let { children, ...context } = this.props; | |
return context; | |
} | |
render ({ children }) { | |
return children && children[0] || null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amended!