MCPcopy Create free account
hub / github.com/editablejs/editable / useTableRowContentHeights

Function useTableRowContentHeights

packages/plugins/table/src/row/store.ts:45–59  ·  view source on GitHub ↗
(rows: GridRow[])

Source from the content-addressed store, hash-verified

43}
44
45export const useTableRowContentHeights = (rows: GridRow[]) => {
46 const refresh = useCallback(() => {
47 return rows.map(row => {
48 const store = getRowStore(row)
49 return store.getState().contentHeight || row.height || 0
50 })
51 }, [rows])
52
53 const [heights, setHeights] = useState<number[]>(refresh)
54 useIsomorphicLayoutEffect(() => {
55 setHeights(refresh())
56 }, [refresh])
57
58 return heights
59}
60
61export const RowStore = {
62 getStore: getRowStore,

Callers 1

TableComponentFunction · 0.90

Calls 1

getRowStoreFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…