From 30edf0d3a7e8be61672e16671bd1f4274ffd0eb8 Mon Sep 17 00:00:00 2001 From: Jorge Cabiedes Acosta Date: Fri, 27 Sep 2024 08:56:47 -0700 Subject: [PATCH] Fix mixBlendMode not updating on Image state updates (#46680) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46680 Since the parent of a view with mixBlendMode prop set is the one responsible for setting the compositing of the child, when updating mixBlendMode on a child we need to also invalidate the parent. Changelog: [Android] [Fixed] - mixBlendMode now properly does state updates Reviewed By: joevilches Differential Revision: D63424394 --- .../java/com/facebook/react/uimanager/BaseViewManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java index 4c9df40644a5bb..2256d5889b3d5f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java @@ -213,6 +213,11 @@ public void setFilter(@NonNull T view, @Nullable ReadableArray filter) { public void setMixBlendMode(@NonNull T view, @Nullable String mixBlendMode) { if (ViewUtil.getUIManagerType(view) == UIManagerType.FABRIC) { view.setTag(R.id.mix_blend_mode, BlendModeHelper.parseMixBlendMode(mixBlendMode)); + // We need to trigger drawChild for the parent ViewGroup which will set the + // mixBlendMode compositing on the child + if (view.getParent() instanceof View) { + ((View) view.getParent()).invalidate(); + } } }