【发布时间】:2019-08-14 16:22:08
【问题描述】:
我是使用 expo 的 react-native 新手。在打开 expo 应用程序并从 http://localhost:19002/ 扫描 QR 码时,我连接了隧道,但在我的设备中总是出现错误说明出现问题或在 http://localhost:19002/ 我收到错误日志,因为我们注意到您的隧道有问题。这可能是由于我们的隧道提供商出现间歇性问题。如果您无法连接到您的应用程序,请尝试重新启动项目,或将主机切换到局域网。
这是我试图在我的移动设备上测试的代码。
import React from "react";
import { StyleSheet, Text, View, Image } from "react-native";
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={styles.title}> Cart </Text>
</View>
<Text style={styles.paragraph}>
Change code in the editor and watch it change on your phone! Save to
get a shareable url.
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
paddingTop: Constants.statusBarHeight,
backgroundColor: "#ecf0f1",
padding: 8
},
paragraph: {
margin: 24,
fontSize: 18,
fontWeight: "bold",
textAlign: "center"
},
header: {
display: "flex",
flex: 1,
height: "10px",
width: "100%",
backgroundColor: "#232323",
color: "white"
},
title: {
textAlign: "center",
margin: "0 auto",
textSize: "6px"
}
});
【问题讨论】:
标签: javascript reactjs react-native expo