instea/react-native-popup-menu

rendererProps doesn't work

Closed this issue · 4 comments

I'm trying to pass style properties to ContextMenu component but it doesn't work:

    
<Menu renderer={renderers.ContextMenu}  rendererProps={{style: {marginLeft: 20}}}>
           <MenuTrigger>
                        {Item}
            </MenuTrigger>
             <MenuOptions>
                    <NavigationList type='popup' items={data} />
              </MenuOptions>
</Menu >

I logged style object in render method of ContextMenu component and got this:

console.log(style)
// result: [undefined, undefined]

not sure, but styling is not done via rendererProps.... check our styling example. rendererProps is escape hatch for "other" props that are not controlled via other (more semantic props).

@sodik82 Yes, I checked styling example, but I didn't find example how to control position of ContextMenu element, i.e. add margin. So I tried to do it via rendererProps but also didn't come to success

something like https://stackoverflow.com/questions/58435267/how-to-add-offset-to-the-popup-menu or https://stackoverflow.com/questions/45577484/react-native-popup-menu-moving-the-options-box ?

I know it is a bit tricky because there is no single style that controls how popup menu looks

@sodik82 thanks, that's exactly what I need