33import React from 'react' ;
44import { Platform , ScrollView , View } from 'react-native' ;
55
6- import type { IViewProps } from '@fluentui-react-native/adapters' ;
76import { FocusZone } from '@fluentui-react-native/focus-zone' ;
87import type { UseSlots } from '@fluentui-react-native/framework' ;
9- import { compose , mergeProps , stagedComponent , withSlots } from '@fluentui-react-native/framework' ;
8+ import { compose , withSlots } from '@fluentui-react-native/framework' ;
109
1110import { stylingSettings } from './MenuList.styling' ;
1211import type { MenuListProps , MenuListState , MenuListType } from './MenuList.types' ;
@@ -15,25 +14,6 @@ import { useMenuList } from './useMenuList';
1514import { useMenuListContextValue } from './useMenuListContextValue' ;
1615import { MenuListProvider } from '../context/menuListContext' ;
1716
18- const MenuStack = stagedComponent ( ( props : React . PropsWithRef < IViewProps > & { gap ?: number } ) => {
19- const { gap, ...rest } = props ;
20- return ( final : React . PropsWithRef < IViewProps > & { gap ?: number } , children : React . ReactNode ) => {
21- if ( gap && gap > 0 && children ) {
22- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23- // @ts -ignore - GH:1684, fix typing error
24- children = React . Children . map ( children , ( child : React . ReactChild , index : number ) => {
25- if ( React . isValidElement ( child ) && index > 0 ) {
26- return React . cloneElement ( child , mergeProps ( child . props , { style : { marginTop : gap } } ) ) ;
27- }
28- return child ;
29- } ) ;
30- }
31-
32- return < View { ...mergeProps ( rest , final ) } > { children } </ View > ;
33- } ;
34- } ) ;
35- MenuStack . displayName = 'MenuStack' ;
36-
3717const shouldHaveFocusZone = [ 'macos' , 'win32' ] . includes ( Platform . OS as string ) ;
3818const focusLandsOnContainer = Platform . OS === 'macos' ;
3919const hasCircularNavigation = Platform . OS === ( 'win32' as any ) ;
@@ -46,9 +26,9 @@ export const MenuList = compose<MenuListType>({
4626 displayName : menuListName ,
4727 ...stylingSettings ,
4828 slots : {
49- root : MenuStack ,
29+ root : View ,
5030 scrollView : ScrollView ,
51- focusZone : shouldHaveFocusZone ? FocusZone : React . Fragment ,
31+ focusZone : shouldHaveFocusZone ? FocusZone : View ,
5232 } ,
5333 useRender : ( userProps : MenuListProps , useSlots : UseSlots < MenuListType > ) => {
5434 const menuList = useMenuList ( userProps ) ;
0 commit comments