Skip to content

Commit

Permalink
Revert a small change to UIManagerBinding
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

This reverts a small change from D26885562 (facebook@ea1f953). I'm not sure if this change was made intentionally (feel free to reject this diff if it was luluwu).

Before D26885562 (facebook@ea1f953), if `RN$Bridgeless` was truthy and `RN$stopSurface` was falsey, then the function returned. After D26885562 (facebook@ea1f953), it ran the else clause (which shouldn't be run in bridgeless mode IIUC).

Reviewed By: mdvacca

Differential Revision: D27751583

fbshipit-source-id: daaf5c72fec11f4b2e21d1d2926a5026b984461f
  • Loading branch information
Peter Argany authored and facebook-github-bot committed Apr 14, 2021
1 parent ff47b0e commit 9729d4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ void UIManagerBinding::setSurfaceProps(
void UIManagerBinding::stopSurface(jsi::Runtime &runtime, SurfaceId surfaceId)
const {
auto global = runtime.global();
if (global.hasProperty(runtime, "RN$Bridgeless") &&
global.hasProperty(runtime, "RN$stopSurface")) {
if (global.hasProperty(runtime, "RN$Bridgeless")) {
if (!global.hasProperty(runtime, "RN$stopSurface")) {
// ReactFabric module has not been loaded yet; there's no surface to stop.
return;
}
// Bridgeless mode uses a custom JSI binding instead of callable module.
global.getPropertyAsFunction(runtime, "RN$stopSurface")
.call(runtime, {jsi::Value{surfaceId}});
Expand Down

0 comments on commit 9729d4d

Please sign in to comment.