export default class CalorieScreen extends Component {
constructor() {
super();
this.state = { text: "" };
}
render() {
const { calories } = this.state;
return (
<View style={styles.container}>
<Header
backgroundColor={"#9c8210"}
centerComponent={{
text: "Monkey Chunky",
style: { padding: 100, color: "#fff", fontSize: 20 },
}}
/>
</View>
);
}
}
Run Code Online (Sandbox Code Playgroud)
我创建了一个登录屏幕,当我单击按钮时,该屏幕会进入我的卡路里屏幕,但会出现此错误