Reputation: 12200
I'm trying to style a text element in my component, and when attempting to apply style tag "textStyle", I'm getting the following error:
Here is my code:
import React from 'react';
import { Text } from 'react-native';
// Create a Component
const Header = () => {
return <Text style={textStyle}>Albums!</Text>;
};
const styles = {
textStyle: {
fontSize: 30
}
};
export default Header;
Upvotes: 0
Views: 4818
Reputation: 4232
You are missing styles, see following block of code:
const Header = () => {
return <Text style={styles.textStyle}>Albums!</Text>;
};
Upvotes: 7