MCPcopy Index your code
hub / github.com/adobe/react-spectrum / GridListInner

Function GridListInner

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

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