Skip to content

Commit 90e1610

Browse files
authored
fix: rn 0.85 compatibility (#3545)
## 🎯 Goal This PR takes care of some general housekeeping for the incoming V9. Namely, we: - Bump back the `bottom-sheet` library's version to latest, as it addresses the issues we had before - It also cancels the need of a monkey patch any longer, so we can avoid doing that as well - Converts all `StyleSheet.absoluteFillObject` entries to `StyleSheet.absoluteFill` - We need to do this due to [this breaking change](https://reactnative.dev/blog/2026/04/07/react-native-0.85#stylesheetabsolutefillobject-removed) for RN `0.85` - Destructuring no longer works, so we flatten those styles - Direct usage is still allowed - Where not directly applicable, we create our own `absoluteFillObject`s and use those (not the cleanest but it'll do for now) With this, we should be RN `0.85` compatible as well. ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
1 parent 7a7f927 commit 90e1610

20 files changed

Lines changed: 94 additions & 393 deletions

File tree

examples/SampleApp/App.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import React, { useEffect, useState } from 'react';
2-
import { DevSettings, I18nManager, LogBox, Platform, StyleSheet, useColorScheme, View } from 'react-native';
2+
import {
3+
DevSettings,
4+
I18nManager,
5+
LogBox,
6+
Platform,
7+
StyleSheet,
8+
useColorScheme,
9+
View,
10+
} from 'react-native';
311
import { createDrawerNavigator } from '@react-navigation/drawer';
412
import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native';
513
import { createNativeStackNavigator } from '@react-navigation/native-stack';
@@ -116,14 +124,9 @@ const MessageOverlayBlurBackground = () => {
116124
downsampleFactor={isIOS ? undefined : 12}
117125
pointerEvents='none'
118126
reducedTransparencyFallbackColor='rgba(0, 0, 0, 0.8)'
119-
style={styles.messageOverlayBlurBackground}
120-
/>
121-
<View
122-
style={[
123-
styles.messageOverlayBlurBackground,
124-
{ backgroundColor: semantics.backgroundCoreScrim },
125-
]}
127+
style={StyleSheet.absoluteFill}
126128
/>
129+
<View style={[StyleSheet.absoluteFill, { backgroundColor: semantics.backgroundCoreScrim }]} />
127130
</>
128131
);
129132
};
@@ -488,9 +491,3 @@ const HomeScreen = () => {
488491
};
489492

490493
export default App;
491-
492-
const styles = StyleSheet.create({
493-
messageOverlayBlurBackground: {
494-
...StyleSheet.absoluteFillObject,
495-
},
496-
});

examples/SampleApp/src/components/UserInfoOverlay.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ import Animated, {
1414
withDecay,
1515
withTiming,
1616
} from 'react-native-reanimated';
17-
import {
18-
useChatContext,
19-
useTheme,
20-
useViewport,
21-
UserAvatar,
22-
} from 'stream-chat-react-native';
17+
import { useChatContext, useTheme, useViewport, UserAvatar } from 'stream-chat-react-native';
2318

2419
import { ConfirmationBottomSheet } from './ConfirmationBottomSheet';
2520
import { useAppOverlayContext } from '../context/AppOverlayContext';
@@ -251,7 +246,7 @@ export const UserInfoOverlay = (props: UserInfoOverlayProps) => {
251246
return (
252247
<Animated.View pointerEvents={visible ? 'auto' : 'none'} style={StyleSheet.absoluteFill}>
253248
<GestureDetector gesture={pan}>
254-
<Animated.View style={StyleSheet.absoluteFillObject}>
249+
<Animated.View style={StyleSheet.absoluteFill}>
255250
<GestureDetector gesture={tap}>
256251
<Animated.View
257252
onLayout={({

examples/SampleApp/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,10 +1629,10 @@
16291629
resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.3.tgz#a73bab8eb491d7b8b7be2f0e6c310647835afe83"
16301630
integrity sha512-2xCRM9q9FlzGZCdgDMJwc0gyUkWFtkosy7Xxr6sFgQwn+wMNIWd7xIvYNauU1r64B5L5rsGKy/n9TKJ0aAFeqQ==
16311631

1632-
"@gorhom/bottom-sheet@5.1.8":
1633-
version "5.1.8"
1634-
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-5.1.8.tgz#65547917f5b1dae5a1291dabd4ea8bfee09feba4"
1635-
integrity sha512-QuYIVjn3K9bW20n5bgOSjvxBYoWG4YQXiLGOheEAMgISuoT6sMcA270ViSkkb0fenPxcIOwzCnFNuxmr739T9A==
1632+
"@gorhom/bottom-sheet@5.2.9":
1633+
version "5.2.9"
1634+
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-5.2.9.tgz#57d26ab8a4a881bb4be8fd45a4b9539929c9f198"
1635+
integrity sha512-YwieCsEnTQnN2QW4VBKfCGszzxaw2ID7FydusEgqo7qB817fZ45N88kptcuNwZFnnauCjdyzKdrVBWmLmpl9oQ==
16361636
dependencies:
16371637
"@gorhom/portal" "1.0.14"
16381638
invariant "^2.2.4"

package/bin/__tests__/patch-bottom-sheet-5.1.8-pr-2561.test.js

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)