MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / MasonryImperativeAPI

Interface MasonryImperativeAPI

lib/components/Masonry/types.ts:287–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285 * This is also the `parent` value passed to `cellRenderer` (for `CellMeasurer`).
286 */
287export interface MasonryImperativeAPI {
288 /**
289 * Clears the internal position cache and re-renders.
290 * Cells are positioned again (by the `cellPositioner`) as they are rendered.
291 */
292 clearCellPositions(): void;
293
294 /**
295 * Forcefully re-renders the `Masonry` (and its visible cells).
296 *
297 * Re-rendering a `Masonry` with the same props does not re-render its cells (it is memoized).
298 * Use this method if the underlying cell data has changed but the props have not.
299 */
300 forceUpdate(): void;
301
302 /**
303 * Notifies the `Masonry` that the specified cell has been measured for the first time (while rendering);
304 * the cell is positioned (by the `cellPositioner`) once the current render has been committed, then the `Masonry` re-renders.
305 * Only `rowIndex` (the cell's index) is used.
306 * This method is intended for `CellMeasurer`.
307 */
308 invalidateCellSizeAfterRender(params: MasonryCellPosition): void;
309
310 /**
311 * Resets the internal position cache, synchronously re-computes the positions of all measured cells
312 * (by calling the `cellPositioner` for each of them, in index order), then re-renders.
313 * Reset the `cellPositioner` (e.g. with its `reset` method) before calling this method.
314 */
315 recomputeCellPositions(): void;
316
317 /**
318 * Re-renders the `Masonry`, e.g. after more cells have been loaded (this method is called by `InfiniteLoader`)
319 * or a cell has been re-measured (it is called by `CellMeasurer`'s `measure` function).
320 * Parameters (the index of the first changed cell, as `rowIndex`) are accepted for compatibility with `Grid` and ignored.
321 *
322 * Cached cell positions are not changed: to re-position cells after their sizes have changed,
323 * reset the `cellPositioner` and call `recomputeCellPositions()`.
324 */
325 recomputeGridSize(params?: Partial<MasonryCellPosition>): void;
326}

Callers 9

Masonry.test.tsxFile · 0.80
Masonry.test.tsxFile · 0.65
forceUpdateGridsFunction · 0.65
Masonry.test.tsxFile · 0.65
Masonry.test.tsxFile · 0.80
MasonryLayoutFunction · 0.80
onResizeFunction · 0.80
onResizeFunction · 0.80
Masonry.test.tsxFile · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected