gpt4 book ai didi

reactjs - 如何在 Javascript 上的 React Native 中禁用 `Fast Refresh`(不使用开发者菜单)

转载 作者:行者123 更新时间:2023-12-04 14:37:20 24 4
gpt4 key购买 nike

快速刷新在某些 Detox 测试中被破坏,我需要从 Javascript 中禁用它,而不使用开发人员菜单。
任何的想法?

最佳答案

source code 中找到了答案
对于版本 0.61 :

import { NativeModules } from 'react-native';

if (__DEV__) {
const { DevSettings } = NativeModules;
DevSettings.setHotLoadingEnabled(false);
DevSettings.setLiveReloadEnabled(false);
}
对于版本 >= 0.62 :
import { DevSettings } from "react-native"

if (__DEV__) {
DevSettings._nativeModule.setHotLoadingEnabled(false);
}

关于reactjs - 如何在 Javascript 上的 React Native 中禁用 `Fast Refresh`(不使用开发者菜单),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60729710/

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