From ea3495399bf5ca5558f27419de4f821f7354a54f Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Thu, 4 Mar 2021 22:19:48 -0800 Subject: [PATCH] Android - pass initial props to ViewManager createView in non-Fabric (#31053) Summary: https://github.com/facebook/react-native/issues/31051 When trying to create custom viewmanagers, we don't have props, I have a use case where I want to create views on the basis of provided react prop from react native. ## Changelog [Android] [Changed] - pass initial props to ViewManager createViewInstance method in non-Fabric Pull Request resolved: https://github.com/facebook/react-native/pull/31053 Test Plan: Tested Manually. (Facebook - see D26719538, which should land first) Reviewed By: mdvacca Differential Revision: D26719510 Pulled By: JoshuaGross fbshipit-source-id: ced78aa919e6b433e22ddb7c9eccc3e3e91950e9 --- .../facebook/react/uimanager/NativeViewHierarchyManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java index 26dc859215c..ac2a51d6689 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java @@ -278,7 +278,8 @@ public class NativeViewHierarchyManager { try { ViewManager viewManager = mViewManagers.get(className); - View view = viewManager.createView(tag, themedContext, null, null, mJSResponderHandler); + View view = + viewManager.createView(tag, themedContext, initialProps, null, mJSResponderHandler); mTagsToViews.put(tag, view); mTagsToViewManagers.put(tag, viewManager);