The following is part of my reactive component. I have a props named daysUntil included in this component that contains a number. In this example, the number 0 is passed, resulting in the fontWeight function returning 700
render: function() { return ( <Text style={this.style()}> {this.props.day} </Text> ) }, style: function() { return { fontWeight: this.fontWeight() } }, fontWeight: function() { var weight = 7 - this.props.daysUntil; return weight * 100; }
I get the following error:
JSON value '700' of type NSNumber cannot be converted to NSSTring.
I assume this is because font-weight expects the value to be in string format. What is the correct fix for this?
Thank you in advance!
source share