I am trying to make stylesheet in react native able to use dynamic value, but i have no idea how to declare it, and can we change the styling name of react native style sheet?
You can declare a stylesheet in react native in this way
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text style={styles.welcomeText}>welcome</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
paddingTop: 10,
backgroundColor: '#ecf0f1',
padding: 8,
},
welcomeText:{
color:'red',
},
});
Read about this in the documentation here.