Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在本机android上找不到变量_Javascript_Android_Reactjs_React Native - Fatal编程技术网

Javascript 在本机android上找不到变量

Javascript 在本机android上找不到变量,javascript,android,reactjs,react-native,Javascript,Android,Reactjs,React Native,所以我对react native是个新手,我刚刚开始构建一个学习应用程序。这里是代码 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 {

所以我对react native是个新手,我刚刚开始构建一个学习应用程序。这里是代码

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"
  }
});
import React from 'react';
import {Button} from 'react-native';

const fetchlocation = props => {
    return(
        <Button title="Get Location" onPress={props.onGetLocation} />
    );
};

export default fetchLocation;
从“React”导入React;
从“react native”导入{样式表、文本、视图、按钮};
从“/components/FetchLocation”导入FetchLocation;
导出默认类App扩展React.Component{
getUserLocationHandler=()=>{
}
render(){
返回(
);
}
}
const styles=StyleSheet.create({
容器:{
弹性:1,
背景颜色:“fff”,
对齐项目:“中心”,
为内容辩护:“中心”
}
});
FetchLocation.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"
  }
});
import React from 'react';
import {Button} from 'react-native';

const fetchlocation = props => {
    return(
        <Button title="Get Location" onPress={props.onGetLocation} />
    );
};

export default fetchLocation;
从“React”导入React;
从“react native”导入{Button};
const fetchlocation=props=>{
返回(
);
};
导出默认位置;
这是一张照片

这是我手机上出现错误的原因

我不认为这是一个复杂的问题,但它确实让我感到沮丧。
谢谢

您在
fetchlocation.js
文件中拼错了
fetchlocation
。它应该用大写字母
L
。没关系,我们每个人都会这样。我投票决定结束这个问题,因为它只是一个小小的打字错误,但如果你愿意,你也可以删除这个问题。