fix: spread DarkTheme to include fonts in NavigationContainer theme

React Navigation v7 requires theme.fonts (medium, regular, bold, heavy).
Providing a partial theme without fonts caused BottomTabItem to crash
with "Cannot read property 'medium' of undefined".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-10 13:45:27 +02:00
1 parent 4027827312
commit 98394bab75
1 file changed
+3 -2
+3 -2
View File
@@ -1,6 +1,6 @@
import React, { useEffect, useState, Component } from 'react'; import React, { useEffect, useState, Component } from 'react';
import { View, StatusBar, Text, ScrollView } from 'react-native'; import { View, StatusBar, Text, ScrollView } from 'react-native';
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer, DarkTheme } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack'; import { createStackNavigator } from '@react-navigation/stack';
import { SafeAreaProvider } from 'react-native-safe-area-context'; import { SafeAreaProvider } from 'react-native-safe-area-context';
@@ -128,8 +128,9 @@ export default function App() {
<SafeAreaProvider> <SafeAreaProvider>
<StatusBar barStyle="light-content" backgroundColor="#121212" /> <StatusBar barStyle="light-content" backgroundColor="#121212" />
<NavigationContainer theme={{ <NavigationContainer theme={{
dark: true, ...DarkTheme,
colors: { colors: {
...DarkTheme.colors,
primary: '#1db954', primary: '#1db954',
background: '#121212', background: '#121212',
card: '#1e1e1e', card: '#1e1e1e',