@rxflow/base
Version:
BaseFlow - 核心 Flow 组件库
20 lines • 547 B
JavaScript
/**
* @author: yanxianliang
* @date: 2025-10-16 19:52
* @modified:2025/10/16 19:52 by yanxianliang
* @desc: 触发画布强制更新
*
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
*/
import { useCallback } from "react";
import { useSetState } from "../state/useSetState";
export var useForceUpdate = function useForceUpdate() {
var setState = useSetState();
return useCallback(function () {
setState(function (state) {
return {
forceRenderTimes: state.forceRenderTimes + 1
};
});
}, []);
};