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
3636
3737 // Initialize refs and update them when the item count changes
3838 useEffect ( ( ) => {
39- itemRefs . current = [ ... Array < undefined > ( itemCount ) ] . map ( ( ) => createRef < HTMLAnchorElement > ( ) ) ;
39+ itemRefs . current = Array . from ( { length : itemCount } , ( ) => createRef < HTMLAnchorElement > ( ) ) ;
4040 } , [ itemCount ] ) ;
4141
4242 // Create type guard
@@ -199,7 +199,7 @@ export default function useDropdownMenu(itemCount: number): DropdownMenuResponse
199199 'aria-expanded' : isOpen ,
200200 } ;
201201
202- const itemProps = [ ... Array < undefined > ( itemCount ) ] . map ( ( _ignore , index ) => ( {
202+ const itemProps = Array . from ( { length : itemCount } , ( _ignore , index ) => ( {
203203 onKeyDown : itemListener ,
204204 tabIndex : - 1 ,
205205 role : 'menuitem' ,
You can’t perform that action at this time.
0 commit comments