我在Windows 10和Ubuntu 16.04上尝试过它.在这两种情况下,Hot Reload仅适用于jsx中的更改,但不能用于更改javascript中的变量或函数或其他内容.热重新加载已启用.实时重新加载已禁用.当我在Visual Studio代码编辑器中保存更改时,虚拟设备(android studio)重新加载,但更改不存在.在EXPO App中的物理设备上也是如此.
首先,我没有安装守望者.Hot Relaod无法正常工作.安装后,Hot Reload也不能正常工作.
我使用create-react-native-app启动应用程序.它没有被驱逐出境.
的package.json:
{
"name": "NativeReduxSaga",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "25.0.0",
"react-native-debugger-open": "^0.3.17",
"react-native-scripts": "1.11.1",
"react-test-renderer": "16.2.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js",
"postinstall": "rndebugger-open --expo"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@redux-offline/redux-offline": "^2.3.2",
"expo": "^25.0.0",
"prop-types": "^15.6.1",
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-autocomplete-input": "^3.5.0",
"react-navigation": "^1.5.2",
"react-redux": "^5.0.7",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.2", …Run Code Online (Sandbox Code Playgroud) watchman react-native react-native-android create-react-native-app hot-reload