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
+24
View File
@@ -0,0 +1,24 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import * as React from 'react';
import useEvent from "./useEvent";
/**
* Same as React.useState but will always get latest state.
* This is useful when React merge multiple state updates into one.
* e.g. onTransitionEnd trigger multiple event at once will be merged state update in React.
*/
export default function useSyncState(defaultValue) {
var _React$useReducer = React.useReducer(function (x) {
return x + 1;
}, 0),
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
forceUpdate = _React$useReducer2[1];
var currentValueRef = React.useRef(defaultValue);
var getValue = useEvent(function () {
return currentValueRef.current;
});
var setValue = useEvent(function (updater) {
currentValueRef.current = typeof updater === 'function' ? updater(currentValueRef.current) : updater;
forceUpdate();
});
return [getValue, setValue];
}