Skip to content

Commit 004d7b4

Browse files
authored
fix: add expo 51 support for expo messaging app. (#2574)
* fix: issues with expo-media-library in expo 51 * chore: change expo-media-library version * chore: change expo-media-library version * chore: change expo-media-library version * fix: unable to upload clicked image on expo 51 using expo-image-picker * fix: update deps * fix: expo-media-library issue
1 parent 5327cde commit 004d7b4

File tree

5 files changed

+1196
-1289
lines changed

5 files changed

+1196
-1289
lines changed

examples/ExpoMessaging/components/AuthProgressLoader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import {ActivityIndicator, StyleSheet} from 'react-native';
3-
import {SafeAreaView} from 'react-native-safe-area-context';
2+
import { ActivityIndicator, StyleSheet } from 'react-native';
3+
import { SafeAreaView } from 'react-native-safe-area-context';
44

55
export const AuthProgressLoader = () => {
66
return (
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const STREAM_API_KEY = 'q95x9hkbyd6p';
22
export const userToken =
33
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoicm9uIn0.eRVjxLvd4aqCEHY_JRa97g6k7WpHEhxL7Z4K4yTot1c';
4+
45
export const user = {
56
id: 'ron',
67
};
Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,33 @@
1-
import { PropsWithChildren, createContext, useContext, useState } from "react";
2-
import { StreamChatGenerics } from "../types";
3-
import { Channel as ChannelType } from "stream-chat";
4-
import { ThreadContextValue } from "stream-chat-expo";
1+
import { PropsWithChildren, createContext, useContext, useState } from 'react';
2+
import { StreamChatGenerics } from '../types';
3+
import { Channel as ChannelType } from 'stream-chat';
4+
import { ThreadContextValue } from 'stream-chat-expo';
55

66
export type AppContextType = {
7-
channel: ChannelType<StreamChatGenerics> | undefined;
8-
setChannel: React.Dispatch<
9-
React.SetStateAction<ChannelType<StreamChatGenerics> | undefined>
10-
>;
11-
setThread: React.Dispatch<
12-
React.SetStateAction<
13-
ThreadContextValue<StreamChatGenerics>["thread"] | undefined
14-
>
15-
>;
16-
thread: ThreadContextValue<StreamChatGenerics>["thread"] | undefined;
7+
channel: ChannelType<StreamChatGenerics> | undefined;
8+
setChannel: React.Dispatch<React.SetStateAction<ChannelType<StreamChatGenerics> | undefined>>;
9+
setThread: React.Dispatch<
10+
React.SetStateAction<ThreadContextValue<StreamChatGenerics>['thread'] | undefined>
11+
>;
12+
thread: ThreadContextValue<StreamChatGenerics>['thread'] | undefined;
1713
};
1814

1915
export const AppContext = createContext<AppContextType>({
20-
channel: undefined,
21-
setChannel: undefined,
22-
setThread: undefined,
23-
thread: undefined,
16+
channel: undefined,
17+
setChannel: undefined,
18+
setThread: undefined,
19+
thread: undefined,
2420
});
2521

2622
export const AppProvider = ({ children }: PropsWithChildren) => {
27-
const [channel, setChannel] = useState<
28-
ChannelType<StreamChatGenerics> | undefined
29-
>(undefined);
30-
const [thread, setThread] = useState<
31-
ThreadContextValue<StreamChatGenerics>["thread"] | undefined
32-
>(undefined);
23+
const [channel, setChannel] = useState<ChannelType<StreamChatGenerics> | undefined>(undefined);
24+
const [thread, setThread] = useState<
25+
ThreadContextValue<StreamChatGenerics>['thread'] | undefined
26+
>(undefined);
3327

34-
return (
35-
<AppContext.Provider value={{ channel, setChannel, thread, setThread }}>
36-
{children}
37-
</AppContext.Provider>
38-
);
28+
return (
29+
<AppContext.Provider value={{ channel, setChannel, thread, setThread }}>
30+
{children}
31+
</AppContext.Provider>
32+
);
3933
};

examples/ExpoMessaging/package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,39 @@
1010
"eject": "expo eject"
1111
},
1212
"dependencies": {
13-
"@react-native-community/netinfo": "11.1.0",
13+
"@react-native-community/netinfo": "11.3.1",
1414
"@react-navigation/elements": "^1.3.30",
15-
"expo": "~50.0.19",
16-
"expo-av": "~13.10.6",
17-
"expo-clipboard": "~5.0.1",
18-
"expo-constants": "~15.4.6",
19-
"expo-document-picker": "~11.10.1",
20-
"expo-file-system": "~16.0.9",
21-
"expo-haptics": "~12.8.1",
22-
"expo-image-manipulator": "~11.8.0",
23-
"expo-image-picker": "~14.7.1",
24-
"expo-linking": "~6.2.2",
25-
"expo-media-library": "~15.9.2",
26-
"expo-router": "~3.4.10",
27-
"expo-sharing": "~11.10.0",
28-
"expo-splash-screen": "~0.26.5",
29-
"expo-status-bar": "~1.11.1",
15+
"expo": "~51.0.14",
16+
"expo-av": "~14.0.5",
17+
"expo-clipboard": "~6.0.3",
18+
"expo-constants": "~16.0.2",
19+
"expo-document-picker": "~12.0.2",
20+
"expo-file-system": "~17.0.1",
21+
"expo-haptics": "~13.0.1",
22+
"expo-image-manipulator": "~12.0.5",
23+
"expo-image-picker": "~15.0.5",
24+
"expo-linking": "~6.3.1",
25+
"expo-media-library": "~16.0.4",
26+
"expo-router": "~3.5.16",
27+
"expo-sharing": "~12.0.1",
28+
"expo-splash-screen": "~0.27.5",
29+
"expo-status-bar": "~1.12.1",
3030
"react": "18.2.0",
3131
"react-dom": "18.2.0",
32-
"react-native": "0.73.6",
33-
"react-native-gesture-handler": "~2.14.0",
34-
"react-native-quick-sqlite": "^8.0.6",
35-
"react-native-reanimated": "~3.6.2",
36-
"react-native-safe-area-context": "4.8.2",
37-
"react-native-screens": "~3.29.0",
38-
"react-native-svg": "14.1.0",
32+
"react-native": "0.74.2",
33+
"react-native-gesture-handler": "~2.16.1",
34+
"react-native-quick-sqlite": "^8.1.0",
35+
"react-native-reanimated": "~3.10.1",
36+
"react-native-safe-area-context": "4.10.1",
37+
"react-native-screens": "3.31.1",
38+
"react-native-svg": "15.2.0",
3939
"react-native-web": "~0.19.6",
4040
"stream-chat-expo": "link:../../package/expo-package",
4141
"stream-chat-react-native-core": "link:../../package",
42-
"typescript": "^5.3.0"
42+
"typescript": "~5.3.3"
4343
},
4444
"devDependencies": {
45-
"@babel/core": "^7.20.0",
45+
"@babel/core": "^7.24.0",
4646
"@rnx-kit/metro-config": "^1.3.15",
4747
"@rnx-kit/metro-resolver-symlinks": "^0.1.35"
4848
},

0 commit comments

Comments
 (0)