Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native Base button missing styling

I have a native-base app and the styling works but seems to be partially missing from buttons. There are no errors and I have applied no custom styles in my app.

See the screenshot below. The buttons are missing their font color, padding, and maybe some other stuff. This is true for any button type (transparent, border, etc)

I am rendering the buttons with a simple

<Card onPress={console.log("hello") && this.props.navigation.navigate('Game')} key={game.location}>
  <CardItem header>
    <Left>
      <Icon name="ios-game-controller-a" />
      <Body>
        <Text>{game.location}</Text>
        <Text>Stations: {game.stationsCount}</Text>
      </Body>
    </Left>
    <Right>
      {this.gameStatus(game)}
    </Right>
  </CardItem>
  <CardItem>
    <Button primary block><Text>Join Game</Text></Button>
  </CardItem>
</Card>

Any idea why some styles would not be applied?

Screen Shot

like image 851
austinbv Avatar asked Jun 18 '26 02:06

austinbv


2 Answers

I have this problem all the time - make sure you're importing <Text> and <View> from native-base and not react-native.

like image 80
dev Avatar answered Jun 20 '26 16:06

dev


Block button with Card

You need to make use of <Left>, <Body> and <Right> when it comes to aligning components

like image 27
Supriya Kalghatgi Avatar answered Jun 20 '26 15:06

Supriya Kalghatgi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!