Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ios/RNSScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ namespace react = facebook::react;
@property (nonatomic, readonly) BOOL hasHeaderConfig;
@property (nonatomic, readonly, getter=isMarkedForUnmountInCurrentTransaction)
BOOL markedForUnmountInCurrentTransaction;

/**
* Whether the snapshot for the transition made for JS-popped views should be taken after view updates or not.
* *This property was introduced for the sake of integration with reanimated.*
*/
@property (nonatomic) BOOL snapshotAfterUpdates;
#else
@property (nonatomic, copy) RCTDirectEventBlock onAppear;
@property (nonatomic, copy) RCTDirectEventBlock onDisappear;
Expand Down
4 changes: 3 additions & 1 deletion ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ - (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
static const auto defaultProps = std::make_shared<const react::RNSScreenProps>();
_snapshotAfterUpdates = NO;
_props = defaultProps;
_reactSubviews = [NSMutableArray new];
_contentWrapperBox = {};
Expand Down Expand Up @@ -2162,7 +2163,8 @@ - (void)setViewToSnapshot
UIView *superView = self.view.superview;
// if we dismissed the view natively, it will already be detached from view hierarchy
if (self.view.window != nil) {
UIView *snapshot = [self.view snapshotViewAfterScreenUpdates:NO];
auto afterUpdates = self.screenView.snapshotAfterUpdates;
UIView *snapshot = [self.view snapshotViewAfterScreenUpdates:afterUpdates];
snapshot.frame = self.view.frame;
[self.view removeFromSuperview];
self.view = snapshot;
Expand Down
Loading