chore: update ant-design dependencies and add new icon types

This commit is contained in:
Luiz Costa
2025-11-18 09:39:51 -03:00
parent 775e562fe9
commit 5c0094d74e
22648 changed files with 2140248 additions and 29 deletions
+27
View File
@@ -0,0 +1,27 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import * as React from 'react';
/**
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
* We do not make this auto is to avoid real memory leak.
* Developer should confirm it's safe to ignore themselves.
*/
export default function useSafeState(defaultValue) {
var destroyRef = React.useRef(false);
var _React$useState = React.useState(defaultValue),
_React$useState2 = _slicedToArray(_React$useState, 2),
value = _React$useState2[0],
setValue = _React$useState2[1];
React.useEffect(function () {
destroyRef.current = false;
return function () {
destroyRef.current = true;
};
}, []);
function safeSetState(updater, ignoreDestroy) {
if (ignoreDestroy && destroyRef.current) {
return;
}
setValue(updater);
}
return [value, safeSetState];
}