Skip to content

Commit 292268e

Browse files
tomekzawfacebook-github-bot
authored andcommitted
Eliminate double call of shadowNodeFromValue in dispatchCommand (#35695)
Summary: This PR slightly improves the implementation of `dispatchCommand` method of `UIManagerBinding` to use existing variable `shadowNode` instead of calling `shadowNodeFromValue` again. ## Changelog [INTERNAL] [CHANGED] - Eliminated double call of `shadowNodeFromValue` in `dispatchCommand` Pull Request resolved: #35695 Test Plan: Launch RNTester with Fabric enabled and check if `scrollTo` or some other command works properly. Reviewed By: christophpurrer Differential Revision: D42233216 Pulled By: robhogan fbshipit-source-id: db152206060ff599962f47c43fda8ea797f2a8cb
1 parent 4ac4a5c commit 292268e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ jsi::Value UIManagerBinding::get(
493493
auto shadowNode = shadowNodeFromValue(runtime, arguments[0]);
494494
if (shadowNode) {
495495
uiManager->dispatchCommand(
496-
shadowNodeFromValue(runtime, arguments[0]),
496+
shadowNode,
497497
stringFromValue(runtime, arguments[1]),
498498
commandArgsFromValue(runtime, arguments[2]));
499499
}

0 commit comments

Comments
 (0)