From 2e51fa5f5d4f229329ae457ab1a77ba5bcea0448 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Tue, 6 Mar 2018 12:39:37 -0800 Subject: [PATCH] iOS: RCTSurface needs to re-register its root view on bridge reload Summary: When reloading JS during development, surface needs to make sure the root view gets re-registered before attempting to remount it. This fixes redbox on JS reload. Reviewed By: shergin Differential Revision: D7170416 fbshipit-source-id: c84b999d2cdc35cb9e26feef2a1e1a7ce35cfa70 --- React/Base/Surface/RCTSurface.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Base/Surface/RCTSurface.mm b/React/Base/Surface/RCTSurface.mm index 2817cf29aa6418..5bc3de232317d4 100644 --- a/React/Base/Surface/RCTSurface.mm +++ b/React/Base/Surface/RCTSurface.mm @@ -209,6 +209,7 @@ - (void)handleBridgeDidLoadJavaScriptNotification:(NSNotification *)notification } if (isRerunNeeded) { + [self _registerRootView]; [self _run]; } }