gpt4 book ai didi

reactjs - react 来自 app.js 文件的 native 更改未反射(reflect)在世博会上

转载 作者:行者123 更新时间:2023-12-01 01:20:38 25 4
gpt4 key购买 nike

我正在按照官方 React Native 文档来安装和运行示例 React Native 应用程序。我通过以下方式创建了一个示例应用程序:

create-react-native-app AwesomeProject

cd然后我按照指示安装了 Expo 应用程序并扫描了二维码,然后打开了 app.js 文件

app.js

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Text>Changes you make will automatically reload.</Text>
<Text>Shake your phone to open the developer menu.</Text>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},https://stackoverflow.com/questions/278192/view-the-change-history-of-a-file-using-git-versioning
});

然后我删除了<Text>Shake your phone to open the developer menu.</Text>
并保存以检查编辑器上的更改是否反射(reflect)在移动应用程序上。但我还没有看到 expo 应用程序有任何变化。我什至在安卓手机上打开chrome浏览器输入ip地址,还是没有任何变化。

最佳答案

在您从开发人员菜单中打开实时重新加载或热重新加载之前,该应用不会自动重新加载 JavaScript。

可以通过摇动设备或在 iOS 模拟器上按 Cmd+D 或在 Android 模拟器上按 Cmd+M 来访问开发菜单。请注意,在某些 Android 设备上,摇晃需要非常剧烈才能注册。

关于reactjs - react 来自 app.js 文件的 native 更改未反射(reflect)在世博会上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48266431/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com