From 9ac0c01d8c6f601a66e7c129cdd47f6804e16354 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Fri, 5 Aug 2022 17:27:36 -0700 Subject: [PATCH] Fix layout MountItem logging Summary: After. D38153924 (https://github.com/facebook/react-native/commit/e24ce708abffee8ec4521ba8162ea8964eb4429f), layout mount items have 7 int arguments but the logger only pulls out and displays 6, which leads to the following exception: "Caught exception trying to print java.lang.IllegalArgumentException: Invalid type argument to IntBufferBatchMountItem" Changelog: [Internal] Created from CodeHub with https://fburl.com/edit-in-codehub Differential Revision: D38472664 fbshipit-source-id: 1583a5514c2ab662eaf5c4ce4bf33c958cb05282 --- .../mounting/mountitems/IntBufferBatchMountItem.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java index 5f1a4366b3e..f1c9106af58 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java @@ -247,11 +247,13 @@ public class IntBufferBatchMountItem implements MountItem { : ""; s.append(String.format("UPDATE STATE [%d]: %s\n", mIntBuffer[i++], stateString)); } else if (type == INSTRUCTION_UPDATE_LAYOUT) { + int reactTag = mIntBuffer[i++]; + int parentTag = mIntBuffer[i++]; s.append( String.format( - "UPDATE LAYOUT [%d]: x:%d y:%d w:%d h:%d displayType:%d\n", - mIntBuffer[i++], - mIntBuffer[i++], + "UPDATE LAYOUT [%d]->[%d]: x:%d y:%d w:%d h:%d displayType:%d\n", + parentTag, + reactTag, mIntBuffer[i++], mIntBuffer[i++], mIntBuffer[i++],