【发布时间】:2021-01-03 11:30:47
【问题描述】:
当我尝试使用 react-native-gesture 处理程序时,出现以下错误:
:尝试从文件“/Users/user/Project/index.js”解析模块“react-native-gesture-handler”时,包“/Users/user/Project/node_modules/react-native-gesture” -handler/package.json' 已成功找到。但是,这个包本身指定了一个无法解析的“主”模块字段(“/Users/user/Project/node_modules/react-native-gesture-handler/index.js”。事实上,这些文件都不存在:[ ...]
我的 index.js 文件:
/**
* @format
*/
import 'react-native-gesture-handler';
import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import React from 'react';
import {AppRegistry} from 'react-native';
import Logsg from './screens/logsg.js';
import {name as appName} from './app.json';
const AuthStack = () => {
return(
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Logsg" component ={Logsg}/>
</Stack.Navigator>
</NavigationContainer>
)
}
AppRegistry.registerComponent(appName, () => AuthStack);
【问题讨论】:
标签: javascript ios xcode react-native