mirror of
https://github.com/docmost/docmost.git
synced 2026-07-24 19:33:21 +10:00
572452c80b
Add the bases feature: formula engine package, grid/table UI, and the base-embed editor extension, with supporting client and server changes.
13 lines
490 B
TypeScript
13 lines
490 B
TypeScript
import { createContext, useContext } from "react";
|
|
|
|
// Row order is only needed at interaction time (shift-select range math), so
|
|
// rows subscribe to a stable getter instead of the array itself — appending a
|
|
// page must not re-render every mounted row.
|
|
const GridRowOrderContext = createContext<() => string[]>(() => []);
|
|
|
|
export const GridRowOrderProvider = GridRowOrderContext.Provider;
|
|
|
|
export function useGridRowOrder(): () => string[] {
|
|
return useContext(GridRowOrderContext);
|
|
}
|