File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export default function useDropdownMenu(itemCount: number): DropdownMenuResponse
36
36
37
37
// Initialize refs and update them when the item count changes
38
38
useEffect ( ( ) => {
39
- itemRefs . current = [ ... Array < undefined > ( itemCount ) ] . map ( ( ) => createRef < HTMLAnchorElement > ( ) ) ;
39
+ itemRefs . current = Array . from ( { length : itemCount } , ( ) => createRef < HTMLAnchorElement > ( ) ) ;
40
40
} , [ itemCount ] ) ;
41
41
42
42
// Create type guard
@@ -199,7 +199,7 @@ export default function useDropdownMenu(itemCount: number): DropdownMenuResponse
199
199
'aria-expanded' : isOpen ,
200
200
} ;
201
201
202
- const itemProps = [ ... Array < undefined > ( itemCount ) ] . map ( ( _ignore , index ) => ( {
202
+ const itemProps = Array . from ( { length : itemCount } , ( _ignore , index ) => ( {
203
203
onKeyDown : itemListener ,
204
204
tabIndex : - 1 ,
205
205
role : 'menuitem' ,
You can’t perform that action at this time.
0 commit comments