MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / withOptionalKey

Function withOptionalKey

packages/jsx/src/components.ts:172–180  ·  view source on GitHub ↗
(
  props: Omit<P, "key">,
  key: string | undefined,
)

Source from the content-addressed store, hash-verified

170type GridPropsWithOptionalKey = GridProps & { key?: string };
171
172function withOptionalKey<P extends { key?: string }>(
173 props: Omit<P, "key">,
174 key: string | undefined,
175): P {
176 if (key === undefined) {
177 return props as P;
178 }
179 return { ...props, key } as P;
180}
181
182function withVNodeKey<N extends VNode>(vnode: N, key: string | undefined): N {
183 if (key === undefined) {

Callers 15

BoxFunction · 0.85
RowFunction · 0.85
ColumnFunction · 0.85
GridFunction · 0.85
LayersFunction · 0.85
FocusZoneFunction · 0.85
FocusTrapFunction · 0.85
SplitPaneFunction · 0.85
PanelGroupFunction · 0.85
ResizablePanelFunction · 0.85
PanelFunction · 0.85
FormFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected