UNPKG

react-ngl

Version:
14 lines 584 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useComponent = exports.ComponentReactContext = void 0; var react_1 = require("react"); var utils_1 = require("../utils"); exports.ComponentReactContext = react_1.createContext(undefined); exports.useComponent = function () { var component = react_1.useContext(exports.ComponentReactContext); if (!component) { throw new utils_1.ReactNGLError('useComponent hook can only be used in the children of <Component>'); } return component; }; //# sourceMappingURL=useComponent.js.map