UNPKG

706 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var react_1 = require("react");
4var MuiPickersUtilsProvider_1 = require("../../MuiPickersUtilsProvider");
5exports.checkUtils = function (utils) {
6 if (!utils) {
7 // tslint:disable-next-line
8 throw new Error('Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.');
9 }
10};
11function useUtils() {
12 var utils = react_1.useContext(MuiPickersUtilsProvider_1.MuiPickersContext);
13 exports.checkUtils(utils);
14 return utils;
15}
16exports.useUtils = useUtils;