Seshan's Blog

keyboard_backspaceBack to Posts
WHY WON’T MY REACT-NATIVE-ELEMENTS BUTTON STRETCH!?
July 30, 2019

If you were like me and spent way too long trying to get your React Native Elements button to fill the parent width when placed inside a flexDirection: ‘row’ view… here is your solution:

containerStyle={{flex: 1}}

Just throw that prop on your button and EVERYTHING WILL WORK! As always make sure your container also stretches by putting ‘flex: 1’ or setting the width style as 100% (this works well if you have a ScrollView).

ID: 189