@saber2pr/react
Version:
react in Typescript.
20 lines (19 loc) • 528 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function createContext(context) {
var Provider = function (_a) {
var children = _a.children, value = _a.value;
context = value;
return children;
};
var Consumer = function (_a) {
var children = _a.children;
return children(context);
};
return {
Provider: Provider,
Consumer: Consumer,
value: context
};
}
exports.createContext = createContext;