Мой компонент SettingsView есть:
<List style={styles(this.props).backgroundColorTheme}>
<ListItem style={custom.settingsListItem} onPress={() => this.props.navigation.navigate('AppIntro')}>
<MaterialIcons name="import-contacts" size={25} color={'#22364F'}/>
<Text style={custom.settingsText}>
Покажете въвеждащата страница
</Text>
<Entypo name="chevron-right" size={25} style={custom.settingsDetailsArrow}/>
</ListItem>
</List>
Как в атрибуте стиля я могу использовать style = {styles.backgroundColorTheme} вместо style = {styles (this.props) .backgroundColorTheme}
Есть постоянные стили:
import {StyleSheet} from "react-native";
export const styles = (props) => StyleSheet.create({
colorTheme: {
color: props.theme.backgroundColor,
marginTop: 60,
marginBottom: 20,
marginLeft: 20,
fontWeight: '200',
fontSize: 24,
},
backgroundColorTheme: {
backgroundColor: props.theme.backgroundColor,
}
});