1 | import * as React from 'react';
|
2 | import ResizeObserver from 'rc-resize-observer';
|
3 | export default function MeasureCell(_ref) {
|
4 | var columnKey = _ref.columnKey,
|
5 | onColumnResize = _ref.onColumnResize;
|
6 | var cellRef = React.useRef();
|
7 | React.useEffect(function () {
|
8 | if (cellRef.current) {
|
9 | onColumnResize(columnKey, cellRef.current.offsetWidth);
|
10 | }
|
11 | }, []);
|
12 | return React.createElement(ResizeObserver, {
|
13 | data: columnKey
|
14 | }, React.createElement("td", {
|
15 | ref: cellRef,
|
16 | style: {
|
17 | padding: 0,
|
18 | border: 0,
|
19 | height: 0
|
20 | }
|
21 | }, React.createElement("div", {
|
22 | style: {
|
23 | height: 0,
|
24 | overflow: 'hidden'
|
25 | }
|
26 | }, "\xA0")));
|
27 | } |
\ | No newline at end of file |