@antv/s2-react
Version:
use S2 with react
16 lines • 726 B
JavaScript
import { S2_PREFIX_CLS } from '@antv/s2';
import { isFunction } from 'lodash';
import React from 'react';
import { useSpreadSheet } from '../../../hooks/useSpreadSheet';
import './index.less';
export const BaseSheet = React.memo((props) => {
const { containerRef, wrapperRef, pagination } = useSpreadSheet(props);
const children = isFunction(props.children)
? props.children({ pagination })
: props.children;
return (React.createElement("div", { ref: wrapperRef, className: `${S2_PREFIX_CLS}-wrapper` },
React.createElement("div", { ref: containerRef, className: `${S2_PREFIX_CLS}-container` }),
children));
});
BaseSheet.displayName = 'BaseSheet';
//# sourceMappingURL=index.js.map