Style in React Native | Style Type

 App.js:


import React, { useState } from 'react';
import { Text, Button, View, StyleSheet } from 'react-native';
import Exstyles from './exStyles';
const App = () => {
    return (
        <View>
            <Text style={{ fontSize: 30, backgroundColor:'green' }}>Style in
            react native</Text>

            <Text style={styles.textBox}>Style in
            react native</Text>
            <Text style={styles.textBox}>Style in
            react native</Text>
           
            <Text style={Exstyles.textBox}>Style in
            react native</Text>

            <Text style={[styles.textBox, Exstyles.textBox, {marginTop:10}]}>Style in
            react native</Text>

        </View>
    );
};
const styles=StyleSheet.create({
    textBox:{
        color:'white',
        backgroundColor:'blue',
        fontSize:30,
        marginBottom:5,
        padding:10,
        textAlign:'center',
        borderRadius:10,
        borderColor:'red',
        borderWidth:2

    }
})

export default App;


-------------------------------

exStyles.js -


import {StyleSheet} from 'react-native'
export default Exstyles=StyleSheet.create({
    textBox:{
        color:'white',
        backgroundColor:'black',
        fontSize:30,
        marginBottom:5,
        padding:10,
       

    }
})






Comments

Popular posts from this blog

Send Data Child to Parent Component - React Js

Hide , Show and Toggle in ReactJs

Importance Of Web Content In SEO.