Di seguito è parte del mio componente di reazione. Ho degli oggetti di scena chiamati giorni. Non arrivo in questo componente che contiene un numero. In questo esempio è l'essere passare il numero 0 che determina la funzione fontWeight ritorno 700React Native - NSNumber non può essere convertito in NSString
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;
}
ottengo il seguente errore:
JSON value '700' of type NSNumber cannot be converted to NSSTring.
sto assumendo questo è perché font-weight aspetta che il valore per essere in formato stringa. Qual è la correzione corretta per questo?
Grazie in anticipo!