Seshan Ravikumar

aka. Seshpenguin


← Back

title: WHY WON’T MY REACT-NATIVE-ELEMENTS BUTTON STRETCH!? author: Seshan Ravikumar type: post date: 2019-07-30T18:28:02+00:00 url: /2019/07/30/why-wont-my-react-native-elements-button-stretch/ classic-editor-remember:


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).