Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29599

Invariant viloation: Objects are not valid as a React child(found: object with keys {fontweight, fontsize})

$
0
0

code is not reading the values of font-weight and font size but perfectly working with the container. how do I fix it?

import React, { Component } from 'react'
import { StyleSheet, Text, View } from 'react-native'
export default class Splash extends Component {
    render() {
        return (
            <View style={styles.container}>
                <Text> style={styles.title} </Text>
            </View>
        )
    }
}
const styles = StyleSheet.create({
    container: {
        backgroundColor: 'white',
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center',
    },
    title: {
        fontWeight: 'bold',
        fontSize: 18 
    }
})

Viewing all articles
Browse latest Browse all 29599

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>