From fdae944ca77c029931ff98b9eac718193be62525 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 12:47:37 +0100 Subject: [PATCH] Apply fromStyle to parentStyles --- src/style_manager/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index fc2c177c0..b47898a36 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -571,9 +571,16 @@ export default () => { if (props) { const fromStyle = prop.get('fromStyle'); - // TODO parentStyles should be as newStyle - const newStyle = fromStyle ? fromStyle(style) : style; - props.forEach(prop => this.__upProp(prop, newStyle, parentStyles, opts)); + let newStyle = style; + let newParentStyles = parentStyles; + if (fromStyle) { + newStyle = fromStyle(style); + newParentStyles = parentStyles.map(p => ({ + ...p, + style: fromStyle(p.style), + })); + } + props.forEach(prop => this.__upProp(prop, newStyle, newParentStyles, opts)); } }); });