'Margin and React Native Paper is not working

I am trying to move the "three-dot" menu to the right side. So I put a {marginLeft: auto} for it. But, it's not moving to the right. What is the problem?

Also, there is another problem. When I press the 'three-dot' icon, I want to open a popup menu. To do that, I am using react native paper from https://callstack.github.io/react-native-paper/menu.html

The menu should be visible when the icon is pressed. But it's not working. What went wrong and How may I fix it?

enter image description here



Solution 1:[1]

The left() right() property of react native paper should help you to put your icon where you want.

Therefore, try to call arrow function in ur onPress to trigger ur action like onPress={() => openMenu} and if doesn't work try onPress={openMenu()}.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yuchen Ren