Skip to content

Commit 374351b

Browse files
MaxHeimbrockclaude
andauthored
Upgrade to Expo SDK 57 (#44)
With Xcode 27, `npx expo run:ios` fails on Expo SDK 54 before it even looks at devices: Xcode 27 replaced Simulator.app with DeviceHub.app, and the SDK 54 CLI still checks for Simulator.app. The fix is only in the SDK 56+ CLI, so move the sample to SDK 57. - expo 54 -> 57, react-native 0.81.5 -> 0.86.3, react 19.2.3, and all Expo-managed packages aligned with `npx expo install --fix` - @config-plugins/react-native-webrtc 13 -> 15 (supports SDK 56+) - @livekit/react-native-expo-plugin 1.0.1 -> 1.0.3 (fixes the config-plugins import that broke on SDK 57) - typescript 6.0 as a dev dependency only; drop the stray runtime entry - CI on Node 22, required by react-native 0.86 and Metro - useThemeColor: ColorSchemeName now includes 'unspecified'; treat everything except 'dark' as light - ControlBar: derive the track reference with useMemo instead of setState inside an effect (new react-hooks lint rule) Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 0438f5d commit 374351b

5 files changed

Lines changed: 2926 additions & 2433 deletions

File tree

‎.github/workflows/test.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-node@v6
1919
with:
20-
node-version: '18.x'
20+
node-version: '22.x'
2121

2222
- uses: actions/cache@v5
2323
with:

‎app/assistant/ui/ControlBar.tsx‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TrackReference, useLocalParticipant } from '@livekit/components-react';
22
import { BarVisualizer } from '@livekit/react-native';
3-
import { useEffect, useState } from 'react';
3+
import { useMemo } from 'react';
44
import {
55
ViewStyle,
66
StyleSheet,
@@ -29,22 +29,18 @@ type ControlBarOptions = {
2929

3030
export default function ControlBar({ style = {}, options }: ControlBarProps) {
3131
const { microphoneTrack, localParticipant } = useLocalParticipant();
32-
const [trackRef, setTrackRef] = useState<TrackReference | undefined>(
33-
undefined
32+
const trackRef = useMemo<TrackReference | undefined>(
33+
() =>
34+
microphoneTrack
35+
? {
36+
participant: localParticipant,
37+
publication: microphoneTrack,
38+
source: microphoneTrack.source,
39+
}
40+
: undefined,
41+
[microphoneTrack, localParticipant]
3442
);
3543

36-
useEffect(() => {
37-
if (microphoneTrack) {
38-
setTrackRef({
39-
participant: localParticipant,
40-
publication: microphoneTrack,
41-
source: microphoneTrack.source,
42-
});
43-
} else {
44-
setTrackRef(undefined);
45-
}
46-
}, [microphoneTrack, localParticipant]);
47-
4844
// Images
4945
let micImage = options.isMicEnabled
5046
? require('@/assets/images/mic_24dp.png')

‎hooks/useThemeColor.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export function useThemeColor(
1010
props: { light?: string; dark?: string },
1111
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
1212
) {
13-
const theme = useColorScheme() ?? 'light';
13+
// ColorSchemeName can also be null or 'unspecified'; treat everything but 'dark' as light.
14+
const theme = useColorScheme() === 'dark' ? 'dark' : 'light';
1415
const colorFromProps = props[theme];
1516

1617
if (colorFromProps) {

0 commit comments

Comments
 (0)