"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePropState = void 0;
const react_1 = require("react");
const usePropState = (prop, disable = false) => {
    const s = (0, react_1.useState)(prop);
    (0, react_1.useEffect)(() => {
        if (!disable || !s[0]) {
            s[1](prop);
        }
    }, [prop, disable]);
    return s;
};
exports.usePropState = usePropState;
//# sourceMappingURL=usePropState.js.map