Есть ли способ разрешить модуль в React Native? - PullRequest
2 голосов
/ 08 февраля 2020

Я новичок в React Native, и я столкнулся с ошибкой. Он говорит, что это не удается разрешить модуль react-native-screens из node_modules/react-navigation stack/lib/module/vendor/views/Stack/CardStack.js Затем он говорит мне, как это исправить, но они не работают. Не могли бы вы помочь?

Вот симулятор:

enter image description here

А вот мои два файла:

Приложение. js:

import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import {HomeScreen} from './components/HomeScreen';
import {LoginScreen} from './components/HomeScreen';
const RootStack = createStackNavigator(
  {
    Home: HomeScreen,
    Login: LoginScreen,
  }, {
    initialRouteName: "Home"
  }
);
const App = createAppContainer(MainNavigator);
export default App;

HomeScreen. js:

import React from 'react';
import {
  StyleSheet,
  ScrollView,
  View,
  Text,
  StatusBar,
  Image,
  TouchableOpacity
} from 'react-native';
import SafeAreaView from 'react-native-safe-area-view';
import {
  Colors,
} from 'react-native/Libraries/NewAppScreen';

class HomeScreen extends Component {
render() {
const {navigate} = this.props.navigation;
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        <ScrollView
          contentInsetAdjustmentBehavior="automatic"
          style={styles.scrollView}>
          <View style={styles.body}>
            <View style={styles.sectionContainer}>
              <View style={styles.sectionContainer2}>
              <Image style={styles.logo} source={require('./images/img1.jpg')} />
              <Image style={styles.logo} source={require('./images/img2.jpg')} />
              <Image style={styles.logo} source={require('./images/img3.jpg')} />
              <Image style={styles.logo} source={require('./images/img4.jpg')} />
              <Image style={styles.logo} source={require('./images/img7.jpg')} />
              <Image style={styles.logo} source={require('./images/img8.jpg')} />
            </View>
          </View>
        </ScrollView>
      </SafeAreaView>
        </>
  );
};
}
export default HomeScreen;

Спасибо!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...