未定义不是一个对象(评估this.props = props')反应本地博览会
2019-11-18
257
刚刚启动项目,很糟糕
代码:
import React, {Component} from 'react';
import { Text, View } from 'react-native';
export default class SignUp extends Component() {
constructor(props){
super(props);
}
render() {
return (
<View>
<Text>SignUp</Text>
</View>
);
}
}
堆栈导航器:
import { createStackNavigator } from "react-navigation";
import SignUp from "../screens/SignUpScreen";
export default AuthStackNavigator = createStackNavigator({
SignUp: SignUp,
})
出现此错误:
1个回答
这是因为你应该写
export default class SignUp extends Component { ... }
而不是
export default class SignUp extends Component() { ... }
Hurobaki
2019-11-18