无法解析"fbjs/lib/areEqual";来自"node_modules \ react-native-gesture-handler \ createHandler.js" [英] Unable to resolve "fbjs/lib/areEqual" from "node_modules\react-native-gesture-handler\createHandler.js"
问题描述
我正在使用expo构建本机应用程序,但是,我遇到了一个错误,因此无法继续构建该应用程序.我什至在错误消息中提到的node_modules中查找文件.我在屏幕导航中使用react-native-gesture-handler.如果我卸载了react-native-gesture-handler并删除了导航代码,是否可以解决我的错误?我该如何解决?
I'm building a react-native application with expo, however, I have an error, therefore I'm unable to continue building the application. I even looked for the file in node_modules that is mentioned in the error message. I'm using the react-native-gesture-handler for my screen navigation. If I uninstalled the react-native-gesture-handler and I removed the navigation code would this solve my error? How do I resolve this?
App.js
import React, { Component } from 'react';
import { StackNavigator } from 'react-navigation';
import Plan from './screens/Plan';
import Home from './screens/Home';
const AppNavigator = StackNavigator({
PlanScreen: { screen: Home },
HomeScreen: { screen: Plan }
});
export default class App extends Component {
render() {
return (
<AppNavigator/>
)
}
}
Home.js
import React, { Component } from 'react';
import { View, Text, Button, TextInput } from 'react-native';
import MyDatePicker from './Components/DatePicker.js'
import ImageSelector from './Components/ImageSelector.js'
export class Home extends Component {
constructor(props) {
super(props);
this.state = {text: 'input'}
}
render() {
return (
<View>
<Text>Plan Name:</Text>
<TextInput style={{height: 40, borderColor: 'black', borderWidth: 0.8}}
onChangeText={(text) => this.setState({text})}
value={this.state.text}/>
<Button style={{ width: 50, alignSelf: "flex-end" }}
title="Add Plan"
onPress={() =>
this.props.navigation.navigate('PlanScreen')}>
<MyDatePicker/>
<ImageSelector/>
</Button>
</View>
)
}
}
推荐答案
我刚刚在我的项目中通过执行npm install fbjs
解决了这个问题.
I just solved this in my project by doing npm install fbjs
.
fbjs
utils具有所需的(并且缺少的)"areEqual": "fbjs/lib/areEqual",
这篇关于无法解析"fbjs/lib/areEqual";来自"node_modules \ react-native-gesture-handler \ createHandler.js"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!