热装不热装 [英] Hot reload doesn't hot-reload
问题描述
我激活了热装,但不是热装.当我对任何Javascript文件进行更改时,打包程序将重新运行,并且模拟器在顶部放一个灰色条,显示正在热加载..."几秒钟.
I activated hot reloading and it's not hot-reloading. When I make a change to any Javascript file, the Packager re-runs and the simulator puts a gray bar at the top saying "Hot reloading..." for a few seconds.
但是就是这样.该应用程序的行为没有改变,并且调试器(在Chrome中)显示了未更改的文件.
But that is it. The behavior of the app doesn't change and the debugger (in Chrome) shows the unchanged file.
我有点茫然.知道如何追踪吗?
I'm somewhat at a loss. Any idea how I could track this down?
推荐答案
根据开发人员的热重装仍处于开发阶段,并且存在很多问题.您始终可以完全重新运行该应用程序,但热重装有时像超级按钮一样工作,完全没有其他作用.
The hot reloading according to the developers is still in development phase and is quite buggy. You could always do a full re-run of the app but the hot reload works like a charm sometimes and not at all otherwise.
https://facebook. github.io/react-native/blog/2016/03/24/introducing-hot-reloading.html
警告:由于JavaScript是一种非常有状态的语言,因此无法完美实现热重装.在实践中,我们发现当前的设置对于大量的常规用例都可以很好地工作,并且万一遇到麻烦,可以进行全面的重新加载.
Word of warning: because JavaScript is a very stateful language, hot reloading cannot be perfectly implemented. In practice, we found out that the current setup is working well for a large amount of usual use cases and a full reload is always available in case something gets messed up.
这篇关于热装不热装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!