In the Button docs from React-Native here it shows an image which says: Fit to text layout
. That is what I am searching for because my button always has full width, but I want it to only be as wide as the text is. But neither in the docs nor in the button code here I can find something related to that a prop or how can it achieve. Somebody has an idea how to get it?
React Native Button: Fit to text layout
2k views Asked by Moritz Pfeiffer At
2
I suggest making your own button with TouchableOpacity and Text.
For example this is my component I often use :
You can found the full gist here if you want : https://gist.github.com/Sangrene/176c1b87ad5b355e26b5c6aa80b96eae.