@rxflow/base
Version:
BaseFlow - 核心 Flow 组件库
19 lines • 604 B
JavaScript
/**
* @author: yanxianliang
* @date: 2025-06-21 13:16
* @desc: 节点主题配置
*
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
*/
import { useShallow } from "zustand/react/shallow";
import { useMemo } from "react";
import { getThemeWithDefaultValue } from "../utils/getThemeWithDefaultValue";
import { usePropsSelector } from "./props/usePropsSelector";
export var useTheme = function useTheme() {
var theme = usePropsSelector(useShallow(function (state) {
return state.theme;
}));
return useMemo(function () {
return getThemeWithDefaultValue(theme);
}, [theme]);
};