duoyun-ui
Version:
A lightweight desktop UI component library, implemented using Gem
19 lines (18 loc) • 795 B
JavaScript
import React from 'react';
import { forwardRef, useImperativeHandle, useRef, useLayoutEffect } from 'react';
export * from '../patterns/table';
export const DyPatTable = forwardRef(function (props, ref) {
const elementRef = useRef(null);
useImperativeHandle(ref, () => {
return {};
}, []);
// React Bug?
useLayoutEffect(() => {
const element = elementRef.current;
["filterable", "selectable", "pagesize", "sizes", "data", "paginationStore", "locationStore", "rowKey", "getRowStyle", "expandedRowRender", "getActions", "getSelectedActions", "columns", "getText"].map(name => {
element[name] = props[name];
});
}, []);
return React.createElement("dy-pat-table", { ref: elementRef, ...props });
});
export default DyPatTable;