button text style react native code example

Example 1: react native create button

import { Button } from 'react-native-elements';
import Icon from 'react-native-vector-icons/FontAwesome';

<View style={styles.buttonContainer}>
<Button title='update state' onPress={do something}/>
</View>

or

<Button
  title="Solid Button"
/>

<Button
  title="Outline button"
  type="outline"
/>

<Button
  title="Clear button"
  type="clear"
/>

<Button
  icon={
    <Icon
      name="arrow-right"
      size={15}
      color="white"
    />
  }
  title="Button with icon component"
/>

<Button
  icon={{
    name: "arrow-right",
    size: 15,
    color: "white"
  }}
  title="Button with icon object"
/>

<Button
  icon={
    <Icon
      name="arrow-right"
      size={15}
      color="white"
    />
  }
  iconRight
  title="Button with right icon"
/>

<Button
  title="Loading button"
  loading
/>
    
Source:
https://reactnativeelements.com/docs/button/

Example 2: button style not working react native

//React Native Button element doesn't have style props and offers very 
//few customization. Use TochableXXX elements instead.
//TouchableOpacity works fine
//Or you can use Button from React-native-elements library

import {
  TouchableOpacity,
  Text,
} from "react-native";

<TouchableOpacity
          style={styles.button}
          onPress={this.onSubmit}
          disabled={!this.state.isFormValid}
        >
          <Text style={styles.btnText}>Add
			</Text>
</TouchableOpacity>

const styles = StyleSheet.create({

  button: {
    width: 200,
    marginTop: 20,
    backgroundColor: "green",
    padding: 15,
    borderRadius: 50,
  },
  btnText: {
    color: "white",
    fontSize: 20,
    justifyContent: "center",
    textAlign: "center",
  },
});