所以我是新来的响应本机的人,我刚开始构建一个学习应用,这里是代码
App.js
import React from "react";
import { StyleSheet, Text, View, Button } from "react-native";
import FetchLocation from "./components/FetchLocation";
export default class App extends React.Component {
getUserLocationHandler = () => {
}
render() {
return (
<View style={styles.container}>
<FetchLocation onGetLocation={this.getUserLocationHandler}/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center"
}
});
FetchLocation.js
import React from 'react';
import {Button} from 'react-native';
const fetchlocation = props => {
return(
<Button title="Get Location" onPress={props.onGetLocation} />
);
};
export default fetchLocation;
的图片
这是我的手机上错误的screenshot
我不认为这是一个复杂的问题,但这确实使我感到沮丧。 谢谢