mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 18:44:25 +00:00
call toString on fontWeight else throws error if passed an integer
Summary: expects a string, throws error NSNumber cannot be converted to NSString if passed an integer, added toString() method to allow integers, and keep consistency, fontSize allows int. Closes https://github.com/facebook/react-native/pull/10483 Differential Revision: D5128581 Pulled By: shergin fbshipit-source-id: 21b1ddd35210c8f061506d71b936cc0ff490d999
This commit is contained in:
parent
eac399b696
commit
7cddaa02d6
@ -457,11 +457,12 @@ function extractFont(font) {
|
||||
}
|
||||
var fontFamily = extractSingleFontFamily(font.fontFamily);
|
||||
var fontSize = +font.fontSize || 12;
|
||||
var fontWeight = font.fontWeight != null ? font.fontWeight.toString() : '400';
|
||||
return {
|
||||
// Normalize
|
||||
fontFamily: fontFamily,
|
||||
fontSize: fontSize,
|
||||
fontWeight: font.fontWeight,
|
||||
fontWeight: fontWeight,
|
||||
fontStyle: font.fontStyle,
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user