import React from 'react';
function useUnmount(unmount) {
var unmountRef = React.useRef();
unmountRef.current = unmount;
React.useEffect(function () {
return function () {
if (unmountRef.current) {
unmountRef.current();
}
};
}, []);
}
export default useUnmount;