Reputation: 6938
I am trying to use fontVariant
on a Text style. The documentation says it expects an "array of enum". How does that look like in json? I have tried passing a string, and it works on android is ignored on android, but throws an error on ios:
<Text style={{ fontVariant: 'small-caps' }}>some text</Text>
will throw:
JSON value 'small-caps' of type NSString cannot be converted to NSArray
I am on version 0.53.3 react-native
Upvotes: 4
Views: 4420
Reputation: 3201
According to the source PropTypes, it expects an array of strings matching the enum:
<Text style={{ fontVariant: [ 'small-caps' ] }}>some text</Text>
Upvotes: 8