MCPcopy
hub / github.com/react-grid-layout/react-grid-layout / cloneLayout

Function cloneLayout

src/core/layout.ts:110–119  ·  view source on GitHub ↗
(layout: Layout)

Source from the content-addressed store, hash-verified

108 * @returns A new layout with cloned items
109 */
110export function cloneLayout(layout: Layout): LayoutItem[] {
111 const newLayout: LayoutItem[] = new Array(layout.length);
112 for (let i = 0; i < layout.length; i++) {
113 const item = layout[i];
114 if (item !== undefined) {
115 newLayout[i] = cloneLayoutItem(item);
116 }
117 }
118 return newLayout;
119}
120
121// ============================================================================
122// Layout Modification

Callers 11

ResponsiveGridLayoutFunction · 0.85
useGridLayoutFunction · 0.85
useResponsiveLayoutFunction · 0.85
compactFunction · 0.85
moveElementFunction · 0.85
compactFunction · 0.85
compactFunction · 0.85
compactFunction · 0.85

Calls 1

cloneLayoutItemFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…