diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f4691d2b2d0..e57c1bdc6d202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Package-specific changes not released in any SDK will be added here just before - Updated `react-native-screens` from `2.2.0` to `2.8.0`. ([#8434](https://github.com/expo/expo/pull/8424) by [@sjchmiela](https://github.com/sjchmiela)) - Updated `react-native-shared-element` from `0.5.6` to `0.7.0`. ([#8427](https://github.com/expo/expo/pull/8427) by [@IjzerenHein](https://github.com/IjzerenHein)) - Updated `react-native-reanimated` from `1.7.0` to `1.9.0`. ([#8424](https://github.com/expo/expo/pull/8424) by [@sjchmiela](https://github.com/sjchmiela)) +- Updated `react-native-safe-area-context` from `0.7.3` to `2.0.1`. ([#8459](https://github.com/expo/expo/pull/8459) by [@brentvatne](https://github.com/brentvatne) and [#8479](https://github.com/expo/expo/pull/8479) by [@tsapeta](https://github.com/tsapeta)) - Updated `@react-native-community/datetimepicker` from `2.2.2` to `2.4.0`. ([#8476](https://github.com/expo/expo/pull/8476) by [@tsapeta](https://github.com/tsapeta)) ### 🛠 Breaking changes diff --git a/apps/bare-expo/package.json b/apps/bare-expo/package.json index d07d8b2550446..38a9a603eaed6 100644 --- a/apps/bare-expo/package.json +++ b/apps/bare-expo/package.json @@ -92,7 +92,7 @@ "react-native-appearance": "~0.3.3", "react-native-gesture-handler": "~1.6.0", "react-native-reanimated": "~1.9.0", - "react-native-safe-area-context": "2.0.0", + "react-native-safe-area-context": "2.0.1", "react-native-screens": "~2.8.0", "react-native-unimodules": "~0.9.1", "react-native-web": "^0.11.4", diff --git a/apps/native-component-list/package.json b/apps/native-component-list/package.json index cbb22b101782f..c5b8c65bbd402 100644 --- a/apps/native-component-list/package.json +++ b/apps/native-component-list/package.json @@ -90,7 +90,7 @@ "react-native-paper": "github:brentvatne/react-native-paper#@brent/fix-bottom-navigation-rn-57", "react-native-platform-touchable": "^1.1.1", "react-native-reanimated": "~1.9.0", - "react-native-safe-area-context": "2.0.0", + "react-native-safe-area-context": "2.0.1", "react-native-safe-area-view": "^0.14.8", "react-native-screens": "~2.8.0", "react-native-shared-element": "0.7.0", diff --git a/home/package.json b/home/package.json index df70158c83bdb..c77342c4c4528 100644 --- a/home/package.json +++ b/home/package.json @@ -51,7 +51,7 @@ "react-native-gesture-handler": "~1.6.0", "react-native-infinite-scroll-view": "^0.4.5", "react-native-maps": "0.26.1", - "react-native-safe-area-context": "^2.0.0", + "react-native-safe-area-context": "2.0.1", "react-navigation": "4.1.0-alpha.1", "react-navigation-material-bottom-tabs": "1.1.1", "react-navigation-stack": "^2.0.15", diff --git a/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaView.m b/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaView.m index a269b1dd92c23..351fcd9fca319 100644 --- a/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaView.m +++ b/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaView.m @@ -45,14 +45,10 @@ - (NSString *)description - (void)safeAreaInsetsDidChange { + [super safeAreaInsetsDidChange]; [self invalidateSafeAreaInsets]; } -- (void)invalidateSafeAreaInsets -{ - [self setSafeAreaInsets:[self realOrEmulateSafeAreaInsets:self.emulateUnlessSupported]]; -} - - (void)layoutSubviews { [super layoutSubviews]; @@ -62,15 +58,10 @@ - (void)layoutSubviews } } -- (void)updateLocalData +- (void)invalidateSafeAreaInsets { - RNCSafeAreaViewLocalData *localData = [[RNCSafeAreaViewLocalData alloc] initWithInsets:_currentSafeAreaInsets - edges:_edges]; - [_bridge.uiManager setLocalData:localData forView:self]; -} + UIEdgeInsets safeAreaInsets = [self realOrEmulateSafeAreaInsets:self.emulateUnlessSupported]; -- (void)setSafeAreaInsets:(UIEdgeInsets)safeAreaInsets -{ if (UIEdgeInsetsEqualToEdgeInsetsWithThreshold(safeAreaInsets, _currentSafeAreaInsets, 1.0 / RCTScreenScale())) { return; } @@ -79,6 +70,13 @@ - (void)setSafeAreaInsets:(UIEdgeInsets)safeAreaInsets [self updateLocalData]; } +- (void)updateLocalData +{ + RNCSafeAreaViewLocalData *localData = [[RNCSafeAreaViewLocalData alloc] initWithInsets:_currentSafeAreaInsets + edges:_edges]; + [_bridge.uiManager setLocalData:localData forView:self]; +} + - (void)setEmulateUnlessSupported:(BOOL)emulateUnlessSupported { if (_emulateUnlessSupported == emulateUnlessSupported) { diff --git a/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaViewLocalData.h b/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaViewLocalData.h index 4463616f9fee5..8faf840d00571 100644 --- a/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaViewLocalData.h +++ b/ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaViewLocalData.h @@ -1,4 +1,5 @@ #import "RNCSafeAreaViewEdges.h" + #import NS_ASSUME_NONNULL_BEGIN diff --git a/packages/expo/bundledNativeModules.json b/packages/expo/bundledNativeModules.json index 2366d45ee9572..3cc8fd1b36166 100644 --- a/packages/expo/bundledNativeModules.json +++ b/packages/expo/bundledNativeModules.json @@ -78,7 +78,7 @@ "expo-in-app-purchases": "~8.1.0", "expo-branch": "~2.1.1", "react-native-appearance": "~0.3.3", - "react-native-safe-area-context": "2.0.0", + "react-native-safe-area-context": "2.0.1", "react-native-shared-element": "0.7.0", "expo-application": "~2.1.1", "expo-battery": "~2.1.1", diff --git a/yarn.lock b/yarn.lock index cc09aea4438ab..d5a74b5f1dbe7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13943,7 +13943,12 @@ react-native-reanimated@~1.9.0: dependencies: fbjs "^1.0.0" -react-native-safe-area-context@2.0.0, react-native-safe-area-context@^2.0.0: +react-native-safe-area-context@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-2.0.1.tgz#c358d8eb6a320b218705b3e77985c3df7b26f04c" + integrity sha512-PjYGbaQVWWYk3fGVgcoZ7RkYNM6K9R2WNoZRSb+ckMZWIan30yENvpKq5HSf9LBkm7AZ046/ehawRTLKiytHCw== + +react-native-safe-area-context@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-2.0.0.tgz#7ef48e5a83a1e2f7fe9d5321493822b6765fd1ab" integrity sha512-5VtCI3Nluzm7QfTcB/3j4YeWqt25QO1u5KTA1jEg1ckJzV19qCZFyHIpCCkS5+VEX+2JEHfdczhCdwE5sPgyEw==