Home > Net >  React Native Base Button fontSize not working
React Native Base Button fontSize not working

Time:09-27

I'm using the React Native Base Button.

The fontSize prop doesn't seem to work at all, it doesn't do anything. Am I doing something wrong, or misunderstanding the prop?

I did install the library using --legacy-peer-deps, because it doesn't offically support React 18 yet, but it seems to be working fine outside of this.

CodePudding user response:

It appears you can pass props to the underlying Text in the Button with the _text prop:

<Button _text={{fontSize: "2xl"}}> 
  Press Me
</Button>

CodePudding user response:

You are trying to increase Button's font size that is why it is not working. Think about that you try to increase TouchableOpacity's font size. Here is a possible Solution

    <Button>
     <Text style={{fontSize:16}} >Button Title</Text>
    </Button>
  • Related