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

Function GridListInner

starters/hooks/src/GridList.tsx:94–120  ·  view source on GitHub ↗
({
  collection,
  layout,
  orientation,
  ...props
}: Omit<GridListProps, 'children'> & {collection: ICollection<Node<object>>})

Source from the content-addressed store, hash-verified

92}
93
94function GridListInner({
95 collection,
96 layout,
97 orientation,
98 ...props
99}: Omit<GridListProps, 'children'> & {collection: ICollection<Node<object>>}) {
100 /*- begin highlight -*/
101 let state = useListState({...props, collection, children: undefined});
102 let ref = useRef<HTMLDivElement>(null);
103 let {gridProps} = useGridList(props, state, ref);
104 /*- end highlight -*/
105
106 return (
107 <div
108 {...gridProps}
109 ref={ref}
110 className="react-aria-GridList"
111 data-layout={layout}
112 data-orientation={orientation}>
113 <ListStateContext.Provider value={state}>
114 {[...state.collection].map(item => (
115 <Fragment key={item.key}>{item.render!(item)}</Fragment>
116 ))}
117 </ListStateContext.Provider>
118 </div>
119 );
120}
121
122export {Text};

Callers

nothing calls this directly

Calls 2

useListStateFunction · 0.90
useGridListFunction · 0.90

Tested by

no test coverage detected