skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

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

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

  2. 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>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search