From a1469f7d280f235f905bce84eba8d3ee17e8563e Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Fri, 31 Mar 2023 11:13:19 -0700 Subject: [PATCH] Modify Arguments.makeNativeObject to handle JavaOnlyMap and JavaOnlyArray (#36743) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36743 Changelog: [Internal] - Modify Arguments.makeNativeObject to handle JavaOnlyMap and JavaOnlyArray Reviewed By: mdvacca Differential Revision: D44516305 fbshipit-source-id: 22a4de4ae1b231078e7cd59cda3993b9f6343f7d --- .../src/main/java/com/facebook/react/bridge/Arguments.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java index c34776b7d80778..d70c4e9faf5164 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java @@ -35,6 +35,10 @@ private static Object makeNativeObject(Object object) { return makeNativeMap((Map) object); } else if (object instanceof Bundle) { return makeNativeMap((Bundle) object); + } else if (object instanceof JavaOnlyMap) { + return makeNativeMap(((JavaOnlyMap) object).toHashMap()); + } else if (object instanceof JavaOnlyArray) { + return makeNativeArray(((JavaOnlyArray) object).toArrayList()); } else { // Boolean, Integer, Double, String, WritableNativeArray, WritableNativeMap return object;