From 2ee66bef7ce688659ecfa6155bad66890a973e60 Mon Sep 17 00:00:00 2001 From: zoomchan-cxj Date: Wed, 15 Mar 2023 16:51:28 +0800 Subject: [PATCH] feat(react): support fontWeight in number --- driver/js/packages/hippy-react/src/dom/element-node.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/driver/js/packages/hippy-react/src/dom/element-node.ts b/driver/js/packages/hippy-react/src/dom/element-node.ts index a52d788f0..f74d283d5 100644 --- a/driver/js/packages/hippy-react/src/dom/element-node.ts +++ b/driver/js/packages/hippy-react/src/dom/element-node.ts @@ -390,6 +390,8 @@ class ElementNode extends ViewNode { (this.style as any)[styleKey] = colorArrayParse((styleValue as Color[])); } else if (styleKey.toLowerCase().indexOf('color') > -1) { (this.style as any)[styleKey] = colorParse((styleValue as Color)); + } else if (styleKey === 'fontWeight' && styleValue) { + (this.style as any)[styleKey] = typeof styleValue !== 'string' ? styleValue.toString() : styleValue; } else if (styleKey === 'backgroundImage' && styleValue) { this.style = parseBackgroundImage(styleKey, styleValue, this.style); } else if (styleKey === 'textShadowOffset') {