duoyun-ui
Version:
A lightweight desktop UI component library, implemented using Gem
19 lines (18 loc) • 682 B
JavaScript
import React from 'react';
import { forwardRef, useImperativeHandle, useRef, useLayoutEffect } from 'react';
export * from '../elements/statistic';
export const DyStatistic = forwardRef(function (props, ref) {
const elementRef = useRef(null);
useImperativeHandle(ref, () => {
return {};
}, []);
// React Bug?
useLayoutEffect(() => {
const element = elementRef.current;
["neutral", "type", "text", "header", "icon", "loading", "value", "prevValue"].map(name => {
element[name] = props[name];
});
}, []);
return React.createElement("dy-statistic", { ref: elementRef, ...props });
});
export default DyStatistic;