Skip to content

Commit 041eebc

Browse files
authored
fix: compile on visionOS (#189)
* fix: compile on visionOS * Create itchy-papayas-move.md
1 parent c30274b commit 041eebc

File tree

8 files changed

+340
-256
lines changed

8 files changed

+340
-256
lines changed

.changeset/itchy-papayas-move.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"react-native-bottom-tabs": patch
3+
"react-native-bottom-tabs-example": patch
4+
---
5+
6+
fix: compile on visionOS

apps/example/src/App.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@ import {
1313
useColorScheme,
1414
Platform,
1515
} from 'react-native';
16-
import {
17-
DarkTheme,
18-
DefaultTheme,
19-
NavigationContainer,
20-
useNavigation,
21-
} from '@react-navigation/native';
16+
import { NavigationContainer, useNavigation } from '@react-navigation/native';
2217
import { createStackNavigator } from '@react-navigation/stack';
2318
import { createNativeStackNavigator } from '@react-navigation/native-stack';
2419
import { SafeAreaProvider } from 'react-native-safe-area-context';
@@ -30,7 +25,6 @@ import SFSymbols from './Examples/SFSymbols';
3025
import LabeledTabs from './Examples/Labeled';
3126
import NativeBottomTabs from './Examples/NativeBottomTabs';
3227
import TintColorsExample from './Examples/TintColors';
33-
import NativeBottomTabsVectorIcons from './Examples/NativeBottomTabsVectorIcons';
3428
import NativeBottomTabsEmbeddedStacks from './Examples/NativeBottomTabsEmbeddedStacks';
3529
import NativeBottomTabsSVGs from './Examples/NativeBottomTabsSVGs';
3630
import NativeBottomTabsRemoteIcons from './Examples/NativeBottomTabsRemoteIcons';
@@ -131,10 +125,6 @@ const examples = [
131125
component: HiddenTab,
132126
name: 'Four Tabs - With Hidden Tab',
133127
},
134-
{
135-
component: NativeBottomTabsVectorIcons,
136-
name: 'Native Bottom Tabs with Vector Icons',
137-
},
138128
{
139129
component: NativeBottomTabsSVGs,
140130
name: 'Native Bottom Tabs with SVG Icons',
@@ -189,12 +179,10 @@ export default function Navigation() {
189179
const [mode, setMode] = React.useState<'native' | 'js'>(defaultStack);
190180

191181
const NavigationStack = mode === 'js' ? Stack : NativeStack;
192-
const colorScheme = useColorScheme();
193-
const theme = colorScheme === 'dark' ? DarkTheme : DefaultTheme;
194182

195183
return (
196184
<SafeAreaProvider>
197-
<NavigationContainer theme={theme}>
185+
<NavigationContainer>
198186
<NavigationStack.Navigator initialRouteName="BottomTabs Example">
199187
<NavigationStack.Screen
200188
name="BottomTabs Example"

apps/example/src/Examples/NativeBottomTabsVectorIcons.tsx

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

apps/example/visionos/Podfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
plugin 'cocoapods-swift-modular-headers'
2+
13
ws_dir = Pathname.new(__dir__)
24
ws_dir = ws_dir.parent until
35
File.exist?("#{ws_dir}/node_modules/react-native-test-app/visionos/test_app.rb") ||
@@ -6,4 +8,9 @@ require "#{ws_dir}/node_modules/react-native-test-app/visionos/test_app.rb"
68

79
workspace 'ReactNativeBottomTabsExample.xcworkspace'
810

11+
apply_modular_headers_for_swift_dependencies()
12+
913
use_test_app!
14+
15+
16+

0 commit comments

Comments
 (0)