D
D
Denis2021-09-17 19:38:13
React Native
Denis, 2021-09-17 19:38:13

How to fix an error with connecting the react-native module?

Hello. I am developing a mobile application. I'm using react-navigation . When debugging, an error pops up (see screenshot).

6144c42d162ae190314273.jpeg

StackNavigator code:

import React from 'react';
import {Image, Text} from 'react-native';

import {createStackNavigator} from '@react-navigation/stack';

import AuthScreen from '../../screens/AuthScreen/AuthScreen';
import HomeScreen from '../../screens/HomeScreen/HomeScreen';

const {Navigator, Screen} = createStackNavigator();

const ScreensOptions = {
  Home: {
    headerTitle: () => (
      <Text style={{color: '#FFFFFF', fontSize: 22}}>Главная</Text>
    ),
    headerRight: () => <Image style={{}} source={require('')} />,
    headerLeft: () => null,
  },
  Auth: {
    title: '',
    headerShown: false,
  },
};

const StackNavigator = ({backgroundColor, textColor}) => {
  return (
    <Navigator
      screenOptions={{
        headerStyle: {backgroundColor: backgroundColor},
        headerTitleStyle: {
          color: textColor,
          fontWeight: 'bold',
        },
      }}
      initialRouteName="Auth">
      <Screen
        name="Auth"
        component={AuthScreen}
        options={ScreensOptions.Auth}
      />
      <Screen
        name="Home"
        component={HomeScreen}
        options={ScreensOptions.Home}
      />
    </Navigator>
  );
};

export default StackNavigator;


Thanks in advance

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question