diff --git a/React/Fabric/Surface/RCTFabricSurface.h b/React/Fabric/Surface/RCTFabricSurface.h index d4dd93c9119..1c3e4af43f7 100644 --- a/React/Fabric/Surface/RCTFabricSurface.h +++ b/React/Fabric/Surface/RCTFabricSurface.h @@ -70,6 +70,13 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)start; - (BOOL)stop; +/** + * EXPERIMENTAL + * Reset's the Surface to it's initial stage. + * It uses the passed in surface presenter, and whatever else was passed in init. + */ +- (void)resetWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter; + #pragma mark - Layout: Setting the size constrains /** diff --git a/React/Fabric/Surface/RCTFabricSurface.mm b/React/Fabric/Surface/RCTFabricSurface.mm index 35368dada39..993985c4846 100644 --- a/React/Fabric/Surface/RCTFabricSurface.mm +++ b/React/Fabric/Surface/RCTFabricSurface.mm @@ -64,6 +64,13 @@ using namespace facebook::react; return self; } +- (void)resetWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter +{ + _surfacePresenter = surfacePresenter; + _stage = RCTSurfaceStageSurfaceDidInitialize; + _view = nil; +} + - (BOOL)start { if (![self _setStage:RCTSurfaceStageStarted]) {