ERROR  TypeError: Cannot convert null value to object

This error is located at:
    in Teszt (created by SceneView)
    in StaticContainer
    in EnsureSingleNavigator (created by SceneView)
    in SceneView (created by SceneView)
    in RCTView (created by View)
    in View (created by DebugContainer)
    in DebugContainer (created by MaybeNestedStack)
    in MaybeNestedStack (created by SceneView)
    in RCTView (created by View)
    in View (created by SceneView)
    in RNSScreen (created by AnimatedComponent)
    in AnimatedComponent
    in AnimatedComponentWrapper (created by InnerScreen)
    in Suspender (created by Freeze)
    in Suspense (created by Freeze)
    in Freeze (created by DelayedFreeze)
    in DelayedFreeze (created by InnerScreen)
    in InnerScreen (created by Screen)
    in Screen (created by SceneView)
    in SceneView (created by NativeStackViewInner)
    in Suspender (created by Freeze)
    in Suspense (created by Freeze)
    in Freeze (created by DelayedFreeze)
    in DelayedFreeze (created by ScreenStack)
    in RNSScreenStack (created by ScreenStack)
    in ScreenStack (created by NativeStackViewInner)
    in NativeStackViewInner (created by NativeStackView)
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by NativeStackView)
    in NativeStackView (created by NativeStackNavigator)
    in PreventRemoveProvider (created by NavigationContent)
    in NavigationContent
    in Unknown (created by NativeStackNavigator)
    in NativeStackNavigator (created by Page)
    in EnsureSingleNavigator
    in BaseNavigationContainer
    in ThemeProvider
    in NavigationContainerInner (created by Page)
    in Page (created by withDevTools(Page))
    in withDevTools(Page)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent), js engine: hermes
 ERROR  TypeError: Cannot convert null value to object

const TipusButton = ({tipus, tantargy}) => {
    const navigation = useNavigation();

    const onPressHandler = () => {
            navigation.navigate('Teszt', {tantargy: tantargy});
    }

import React, {useState, useEffect} from 'react';
import {View, Text, Button} from 'react-native';
import SQLite from 'react-native-sqlite-storage';

const Teszt = () => {
  const [people, setPeople] = useState([]);

  useEffect(() => {
    // Initialize the SQLite database
    const db = SQLite.openDatabase(
      {
        name: 'myDatabase.db',
        location: 'default',
      },
      () => console.log('Database opened successfully'),
      (error) => console.log('Error opening database:', error),
    );

    // Create a table called people with id as primary key, name, and age
    db.transaction((txn) => {
      txn.executeSql('CREATE TABLE IF NOT EXISTS people (id INTEGER PRIMARY KEY AUTOINCREMENT,name VARCHAR(20),age INT');
    });
  }, []);

  const addPerson = () => {
    const db = SQLite.openDatabase({name: 'myDatabase.db', location: 'default'});

    // Insert a person into the people table
    db.transaction((txn) => {
      txn.executeSql(
        'INSERT INTO people (name, age) VALUES (?, ?)',
        ['John Doe', 30],
      );
    });
  };

  const getAllPeople = () => {
    const db = SQLite.openDatabase({name: 'myDatabase.db', location: 'default'});

    // Query all data from the people table
    db.transaction((txn) => {
      txn.executeSql('SELECT * FROM people', [], (tx, results) => {
        const rows = results.rows.raw();
        setPeople(rows);
      });
    });
  };

  return (
    <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
      <Text style={{fontSize: 20, marginBottom: 20}}>
        SQLite Example in React Native
      </Text>
      <Button title="Add Person" onPress={addPerson} />
      <Button title="Get All People" onPress={getAllPeople} />
      <View style={{marginTop: 20}}>
        {people.map((person, index) => (
          <Text key={index}>
            {person.id}: {person.name}, {person.age}
          </Text>
        ))}
      </View>
    </View>
  );
};

export default Teszt;

const Stack = createNativeStackNavigator();

export default function Page() {
  //const router = useRouter();

  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen
          name="TantargyValaszto"
          component={TantargyValaszto}
          options={{
            headerStyle: { backgroundColor: COLORS.primary},
            headerLeft: () => (
              <Menu />
            ),
            headerTitle: ""
          }}
        />
        <Stack.Screen 
          name="TipusValaszto" 
          component={TipusValaszto}
          options={{
            headerStyle: { backgroundColor: COLORS.primary},
            headerTintColor: 'white',
          }}
        />
        <Stack.Screen 
          name="TesztValaszto" 
          component={TesztValaszto} 
          options={{
            headerStyle: { backgroundColor: COLORS.primary},
            headerTintColor: 'white',
          }}
        />
        <Stack.Screen 
          name="Teszt" 
          component={Teszt} 
          options={{
            headerTitle: "",
            headerShadowVisible: false,
          }}
        />
      </Stack.Navigator>
    </NavigationContainer>
  );
}