use dynamic style in react native code example
Example: react native dynamic style
//you can use a function to generate a styleSheet dynamically
styleFunction (option) {
return {
borderWidth: 2,
margin: option,
}
}
<View style={this.styleFunction(15)}>
//things
</View>