MCPcopy Create free account
hub / github.com/adobe/react-spectrum / GridListInner

Function GridListInner

packages/react-aria-components/src/GridList.tsx:243–466  ·  view source on GitHub ↗
({props, collection, gridListRef: ref}: GridListInnerProps<T>)

Source from the content-addressed store, hash-verified

241}
242
243function GridListInner<T>({props, collection, gridListRef: ref}: GridListInnerProps<T>) {
244 // oxlint-disable-next-line react/react-compiler
245 [props, ref] = useContextProps(props, ref, SelectableCollectionContext);
246 let {
247 // eslint-disable-next-line @typescript-eslint/no-unused-vars
248 shouldUseVirtualFocus,
249 filter,
250 disallowTypeAhead,
251 UNSTABLE_focusOnEntry,
252 ...DOMCollectionProps
253 } = props;
254 let {
255 dragAndDropHooks,
256 keyboardNavigationBehavior = 'arrow',
257 layout = 'stack',
258 orientation = 'vertical'
259 } = props;
260 let {
261 CollectionRoot,
262 isVirtualized,
263 layoutDelegate,
264 dropTargetDelegate: ctxDropTargetDelegate
265 } = useContext(CollectionRendererContext);
266 let gridlistState = useListState({
267 ...DOMCollectionProps,
268 collection,
269 children: undefined,
270 layoutDelegate
271 });
272
273 // oxlint-disable-next-line react/react-compiler
274 let filteredState = UNSTABLE_useFilteredListState(gridlistState as ListState<T>, filter);
275 let collator = useCollator({usage: 'search', sensitivity: 'base'});
276 let {disabledBehavior, disabledKeys} = filteredState.selectionManager;
277 let {direction} = useLocale();
278 let keyboardDelegate = useMemo(
279 () =>
280 new ListKeyboardDelegate({
281 collection: filteredState.collection,
282 collator,
283 ref,
284 disabledKeys,
285 disabledBehavior,
286 layoutDelegate,
287 layout,
288 orientation,
289 direction
290 }),
291 [
292 filteredState.collection,
293 ref,
294 layout,
295 orientation,
296 disabledKeys,
297 disabledBehavior,
298 layoutDelegate,
299 collator,
300 direction

Callers

nothing calls this directly

Calls 13

useContextPropsFunction · 0.90
useListStateFunction · 0.90
useCollatorFunction · 0.90
useLocaleFunction · 0.90
useGridListFunction · 0.90
useFocusRingFunction · 0.90
useRenderPropsFunction · 0.90
filterDOMPropsFunction · 0.90
mergePropsFunction · 0.90
useDndPersistedKeysFunction · 0.90
useRenderDropIndicatorFunction · 0.90

Tested by

no test coverage detected