mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add reset method to RCTFabricSurface [2/N]
Summary: This method allows a surface to re-render from scratch, without having to delete and reinstantiate the surface. Changelog: [iOS] Added reset method to RCTFabricSurface to help with reloads Reviewed By: RSNara Differential Revision: D25000509 fbshipit-source-id: f74170aa78cc84491ad2679f130ed3c8965bbe34
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3a0ed2e551
commit
53858ceaa3
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user