Skip to content

Instantly share code, notes, and snippets.

@developit
Last active June 5, 2018 14:21
Show Gist options
  • Save developit/5d879edb820228224dc9 to your computer and use it in GitHub Desktop.
Save developit/5d879edb820228224dc9 to your computer and use it in GitHub Desktop.
// - 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
}
}
@developit
Copy link
Author

Amended!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment