TypeError:未定义不是对象(评估ExpoFontLoader.loadAsync)

时间:2018-09-15 10:32:51

标签: react-native

import React, { Component } from 'react';
import { 
   View, 
   TextInput,
} from 'react-native';
import Icons from 'react-native-vector-icons/FontAwesome';

class EmployeeFrom extends Component {
 render() {
   return (
     <View>
       <View>
         <Icons name="user" size={28}
         style={styles.InputIcons}
         />
         <TextInput style={styles.textInput} 
                placeholder="Name"
                placeholderTextColor="black"
                underlineColorAndroid="rgba(0,0,0,0)"
         />
       </View>
      </View>
    );
   }
  }

我从react-native-vector-icons导入了矢量图标,但仍然出现错误,任何人都可以帮助我

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题。

我被帮助平整了博览会的版本和版本。

是:

package.json

"dependencies": {
  "expo": "^30.0.1",
  "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.
}

app.json

"expo": {
  "sdkVersion": "29.0.0",
}

它变成了:

package.json

"dependencies": {
  "expo": "^30.0.1",
  "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.
}

app.json

"expo": {
  "sdkVersion": "30.0.0",
}