preact-context-provider.js

June 5, 2017 ยท View on GitHub

// - 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 } }