How to use the createContext function from preact

Find comprehensive JavaScript preact.createContext code examples handpicked from public code repositorys.

42
43
44
45
46
47
48
49
50
51
    FakeComponent.prototype.render = function () { return preact.createElement('div', {}); };
    FakeComponent.prototype.componentDidMount = function () { this.setState({}); };
    return FakeComponent;
}(preact.Component));
function createContext(defaultValue) {
    var ContextType = preact.createContext(defaultValue);
    var origProvider = ContextType.Provider;
    ContextType.Provider = function () {
        var _this = this;
        var isNew = !this.getChildContext;
fork icon0
star icon0
watch icon0

+ 5 other calls in file