简体   繁体   English

React-Native应用程序未在Android设备中更新(Windows 10)

[英]React-Native app not updating in android device (Windows 10)

I´ve been trying to build my first app with react native but when I change the App.js the changes are not reflected when I run the app on my anroid device. 我一直在尝试使用本机反应构建我的第一个应用程序,但是当我更改App.js时,在我的anroid设备上运行该应用程序时,更改不会反映出来。 I even tried putting in comments all code to see if something changes but remains the same. 我什至尝试在所有代码中添加注释,以查看是否有任何更改但保持不变。 I´m using react-native-cli: 2.0.1 and react-native: 0.53.3 Sorry if writing wrong but English is not my "native" language :V 我正在使用react-native-cli:2.0.1和react-native:0.53.3对不起,如果写错了,但英语不是我的“母语”语言:V

My code: 我的代码:

App.js App.js

index.js index.js

Hope you can help me, but I will keep trying. 希望您能帮助我,但我会继续努力。

I realized that when the app is running in a virtual device, the changes are reflected. 我意识到,当应用程序在虚拟设备中运行时,更改会得到反映。

For real device, shake your phone to open the debug panel. 对于真实设备,请摇动手机以打开调试面板。
Make sure the Enable hot reloading option is switched on. 确保启用启用热重装选项。
https://facebook.github.io/react-native/docs/debugging.html https://facebook.github.io/react-native/docs/debugging.html

This is not the main problem, but it's better to have a <View></View> component to wrap the Text component. 这不是主要问题,但是最好有一个<View></View>组件来包装Text组件。 So you can add more component and apply styling later on. 因此,您可以添加更多组件并在以后应用样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM