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
2 changes: 1 addition & 1 deletion FabricExample/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import App from '../apps';
import { featureFlags } from 'react-native-screens';

featureFlags.experiment.synchronousScreenUpdatesEnabled = false;
featureFlags.experiment.synchronousHeaderConfigUpdatesEnabled = false;
featureFlags.experiment.synchronousHeaderConfigUpdatesEnabled = true;
featureFlags.experiment.synchronousHeaderSubviewUpdatesEnabled = false;
featureFlags.experiment.androidResetScreenShadowStateOnOrientationChangeEnabled =
true;
Expand Down
57 changes: 27 additions & 30 deletions ios/RNSScreenStackHeaderConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ - (void)initProps
_reactSubviews = [NSMutableArray new];
_backTitleVisible = YES;
_blurEffect = RNSBlurEffectStyleNone;
_synchronousShadowStateUpdatesEnabled = YES;
}

RNS_IGNORE_SUPER_CALL_BEGIN
Expand Down Expand Up @@ -281,11 +282,10 @@ - (UIImage *)loadBackButtonImageInViewController:(UIViewController *)vc
// in the image attribute not being updated. We manually set frame to the size of an image
// in order to trigger proper reload that'd update the image attribute.
RCTImageSource *imageSource = [RNSScreenStackHeaderConfig imageSourceFromImageView:imageView];
[imageView reactSetFrame:CGRectMake(
imageView.frame.origin.x,
imageView.frame.origin.y,
imageSource.size.width,
imageSource.size.height)];
[imageView reactSetFrame:CGRectMake(imageView.frame.origin.x,
imageView.frame.origin.y,
imageSource.size.width,
imageSource.size.height)];
}

UIImage *image = imageView.image;
Expand Down Expand Up @@ -847,13 +847,12 @@ - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompone
return;
}

RCTAssert(
childComponentView.superview == nil,
@"Attempt to mount already mounted component view. (parent: %@, child: %@, index: %@, existing parent: %@)",
self,
childComponentView,
@(index),
@([childComponentView.superview tag]));
RCTAssert(childComponentView.superview == nil,
@"Attempt to mount already mounted component view. (parent: %@, child: %@, index: %@, existing parent: %@)",
self,
childComponentView,
@(index),
@([childComponentView.superview tag]));

// [_reactSubviews insertObject:(RNSScreenStackHeaderSubview *)childComponentView atIndex:index];
[self insertReactSubview:(RNSScreenStackHeaderSubview *)childComponentView atIndex:index];
Expand Down Expand Up @@ -1130,23 +1129,21 @@ @implementation RNSScreenStackHeaderConfigManager

@implementation RCTConvert (RNSScreenStackHeader)

RCT_ENUM_CONVERTER(
UISemanticContentAttribute,
(@{
@"ltr" : @(UISemanticContentAttributeForceLeftToRight),
@"rtl" : @(UISemanticContentAttributeForceRightToLeft),
}),
UISemanticContentAttributeUnspecified,
integerValue)

RCT_ENUM_CONVERTER(
UINavigationItemBackButtonDisplayMode,
(@{
@"default" : @(UINavigationItemBackButtonDisplayModeDefault),
@"generic" : @(UINavigationItemBackButtonDisplayModeGeneric),
@"minimal" : @(UINavigationItemBackButtonDisplayModeMinimal),
}),
UINavigationItemBackButtonDisplayModeDefault,
integerValue)
RCT_ENUM_CONVERTER(UISemanticContentAttribute,
(@{
@"ltr" : @(UISemanticContentAttributeForceLeftToRight),
@"rtl" : @(UISemanticContentAttributeForceRightToLeft),
}),
UISemanticContentAttributeUnspecified,
integerValue)

RCT_ENUM_CONVERTER(UINavigationItemBackButtonDisplayMode,
(@{
@"default" : @(UINavigationItemBackButtonDisplayModeDefault),
@"generic" : @(UINavigationItemBackButtonDisplayModeGeneric),
@"minimal" : @(UINavigationItemBackButtonDisplayModeMinimal),
}),
UINavigationItemBackButtonDisplayModeDefault,
integerValue)

@end
2 changes: 1 addition & 1 deletion src/fabric/ScreenStackHeaderConfigNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface NativeProps extends ViewProps {
onPressHeaderBarButtonMenuItem?:
| CT.DirectEventHandler<OnPressHeaderBarButtonMenuItemEvent>
| undefined;
synchronousShadowStateUpdatesEnabled?: CT.WithDefault<boolean, false>;
synchronousShadowStateUpdatesEnabled?: CT.WithDefault<boolean, true>;

// Experimental
userInterfaceStyle?: CT.WithDefault<UserInterfaceStyle, 'unspecified'>;
Expand Down
2 changes: 1 addition & 1 deletion src/flags.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const RNS_SYNCHRONOUS_SCREEN_STATE_UPDATES_DEFAULT = false;
const RNS_SYNCHRONOUS_HEADER_CONFIG_STATE_UPDATES_DEFAULT = false;
const RNS_SYNCHRONOUS_HEADER_CONFIG_STATE_UPDATES_DEFAULT = true;
const RNS_SYNCHRONOUS_HEADER_SUBVIEW_STATE_UPDATES_DEFAULT = false;
const RNS_ANDROID_LEGACY_TOP_INSET_BEHAVIOR_DEFAULT = false;
const RNS_ANDROID_RESET_SCREEN_SHADOW_STATE_ON_ORIENTATION_CHANGE_DEFAULT =
Expand Down
Loading