我使用的是来自react-native的应用程序。但是在设备上运行应用程序时,会出现以下错误:
App.js :
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, TouchableOpacity} from 'react-native';
import Exponent, {Font, Components} from 'exponent';
import {
NavigationProvider,
StackNavigation,
SharedElementOverlay
} from '@exponent/ex-navigation';
import stl from './components/theme';
const instructions = Platform.select({
ios: 'Press Cmd+R',
android:
'Shake or press',
});
type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1
},
welcome: {
fontSize: 20
},
instructions: {
textAlign: 'center'
},
});
package.json:
{
"name": "mobileshopping",
"version": "0.0.0",
"description": "Hello Exponent!",
"author": "mironcatalin@gmail.com",
"private": true,
"dependencies": {
"@exponent/ex-navigation": "^2.0.0",
"@exponent/vector-icons": "~2.0.3",
"expo": "^33.0.6",
"exponent": "~11.0.2",
"react": "~15.3.2",
"react-native": "0.39.0",
"react-native-animate-number": "^0.1.2"
},
"devDependencies": {
"@exponent/vector-icons": "^2.0.3"
}
}
当我删除App.js文件的第三行时,它工作正常。谁能说为什么出现此错误?
新手:(
感谢分享。
答案 0 :(得分:1)