Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call toString on fontWeight else throws error if passed an integer #10483

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion Libraries/ART/ReactNativeART.js
Expand Up @@ -439,7 +439,7 @@ function extractFont(font) {
}
var fontFamily = extractSingleFontFamily(font.fontFamily);
var fontSize = +font.fontSize || 12;
var fontWeight = font.fontWeight ? font.fontWeight.toString() : "400";
var fontWeight = font.fontWeight ? font.fontWeight.toString() : '400';
return {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quotes: Strings must use singlequote.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i set fontWeight to 0, it will fallback to 400, so i think it's better using font.fontWeight != null ? font.fontWeight.toString() : '400'

// Normalize
fontFamily: fontFamily,
Expand Down