import { useState, useCallback } from 'react';
export var useDrawerExiting = function (visible) {
    var _a = useState(false), exiting = _a[0], setExiting = _a[1];
    var _b = useState(visible), prevVisible = _b[0], setPrevVisible = _b[1];
    var onExited = useCallback(function () {
        setExiting(false);
    }, []);
    if (prevVisible === visible) {
        return { exiting: exiting, onExited: onExited };
    }
    setExiting(!visible);
    setPrevVisible(visible);
    return { exiting: exiting, onExited: onExited };
};
