Alexey K
Alexey K

Reputation: 6723

React Native - ignores styles

I have simple component

class Cart extends Component {
    render() {

            return (
                <View style={{ flex: 1  }}>
                    <View slyle={{ backgroundColor: 'blue', width: 200, height: 200}}>

                            <Text>12</Text>
                    </View>
                </View>
            );

    }
}

And I get

enter image description here

What am I doing wrong ?

Upvotes: 0

Views: 54

Answers (1)

abu_bua
abu_bua

Reputation: 1637

You have a syntax error in line with:

 <View slyle={{ backgroundColor: 'blue', width: 200, height: 200}}>

should be style and NOT slyle

<View style={{ backgroundColor: 'blue', width: 200, height: 200}}>

Upvotes: 2

Related Questions