1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var react_1 = require("react");
|
4 | var MuiPickersUtilsProvider_1 = require("../../MuiPickersUtilsProvider");
|
5 | exports.checkUtils = function (utils) {
|
6 | if (!utils) {
|
7 |
|
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 | };
|
11 | function useUtils() {
|
12 | var utils = react_1.useContext(MuiPickersUtilsProvider_1.MuiPickersContext);
|
13 | exports.checkUtils(utils);
|
14 | return utils;
|
15 | }
|
16 | exports.useUtils = useUtils;
|