Skip to content

Commit

Permalink
fix: compile on visionOS (#189)
Browse files Browse the repository at this point in the history
* fix: compile on visionOS

* Create itchy-papayas-move.md
  • Loading branch information
okwasniewski authored Dec 12, 2024
1 parent c30274b commit 041eebc
Show file tree
Hide file tree
Showing 8 changed files with 340 additions and 256 deletions.
6 changes: 6 additions & 0 deletions .changeset/itchy-papayas-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"react-native-bottom-tabs": patch
"react-native-bottom-tabs-example": patch
---

fix: compile on visionOS
16 changes: 2 additions & 14 deletions apps/example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ import {
useColorScheme,
Platform,
} from 'react-native';
import {
DarkTheme,
DefaultTheme,
NavigationContainer,
useNavigation,
} from '@react-navigation/native';
import { NavigationContainer, useNavigation } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { SafeAreaProvider } from 'react-native-safe-area-context';
Expand All @@ -30,7 +25,6 @@ import SFSymbols from './Examples/SFSymbols';
import LabeledTabs from './Examples/Labeled';
import NativeBottomTabs from './Examples/NativeBottomTabs';
import TintColorsExample from './Examples/TintColors';
import NativeBottomTabsVectorIcons from './Examples/NativeBottomTabsVectorIcons';
import NativeBottomTabsEmbeddedStacks from './Examples/NativeBottomTabsEmbeddedStacks';
import NativeBottomTabsSVGs from './Examples/NativeBottomTabsSVGs';
import NativeBottomTabsRemoteIcons from './Examples/NativeBottomTabsRemoteIcons';
Expand Down Expand Up @@ -131,10 +125,6 @@ const examples = [
component: HiddenTab,
name: 'Four Tabs - With Hidden Tab',
},
{
component: NativeBottomTabsVectorIcons,
name: 'Native Bottom Tabs with Vector Icons',
},
{
component: NativeBottomTabsSVGs,
name: 'Native Bottom Tabs with SVG Icons',
Expand Down Expand Up @@ -189,12 +179,10 @@ export default function Navigation() {
const [mode, setMode] = React.useState<'native' | 'js'>(defaultStack);

const NavigationStack = mode === 'js' ? Stack : NativeStack;
const colorScheme = useColorScheme();
const theme = colorScheme === 'dark' ? DarkTheme : DefaultTheme;

return (
<SafeAreaProvider>
<NavigationContainer theme={theme}>
<NavigationContainer>
<NavigationStack.Navigator initialRouteName="BottomTabs Example">
<NavigationStack.Screen
name="BottomTabs Example"
Expand Down
78 changes: 0 additions & 78 deletions apps/example/src/Examples/NativeBottomTabsVectorIcons.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions apps/example/visionos/Podfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
plugin 'cocoapods-swift-modular-headers'

ws_dir = Pathname.new(__dir__)
ws_dir = ws_dir.parent until
File.exist?("#{ws_dir}/node_modules/react-native-test-app/visionos/test_app.rb") ||
Expand All @@ -6,4 +8,9 @@ require "#{ws_dir}/node_modules/react-native-test-app/visionos/test_app.rb"

workspace 'ReactNativeBottomTabsExample.xcworkspace'

apply_modular_headers_for_swift_dependencies()

use_test_app!



Loading

0 comments on commit 041eebc

Please sign in to comment.