1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4 | Object.defineProperty(exports, "__esModule", {
|
5 | value: true
|
6 | });
|
7 | exports.default = void 0;
|
8 | var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9 | var _react = require("react");
|
10 | var _isMobile = _interopRequireDefault(require("../isMobile"));
|
11 | var _useLayoutEffect = _interopRequireDefault(require("./useLayoutEffect"));
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | var useMobile = function useMobile() {
|
17 | var _useState = (0, _react.useState)(false),
|
18 | _useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
19 | mobile = _useState2[0],
|
20 | setMobile = _useState2[1];
|
21 | (0, _useLayoutEffect.default)(function () {
|
22 | setMobile((0, _isMobile.default)());
|
23 | }, []);
|
24 | return mobile;
|
25 | };
|
26 | var _default = exports.default = useMobile; |
\ | No newline at end of file |