gus*_*ard 2 reactjs react-native
快速刷新在一些排毒测试中被破坏,我需要从 Javascript 中禁用它,而不使用开发人员菜单
任何的想法?
在源代码中找到了答案
对于版本0.61:
import { NativeModules } from 'react-native';
if (__DEV__) {
const { DevSettings } = NativeModules;
DevSettings.setHotLoadingEnabled(false);
DevSettings.setLiveReloadEnabled(false);
}
Run Code Online (Sandbox Code Playgroud)
对于版本 >= 0.62:
import { DevSettings } from "react-native"
if (__DEV__) {
DevSettings._nativeModule.setHotLoadingEnabled(false);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2849 次 |
| 最近记录: |