Fast Refresh is broken in some Detox tests and I need to disable it from Javascript, without using the Developer Menu.
Any idea?
Found the answer in the source code
For version 0.61:
import { NativeModules } from 'react-native';
if (__DEV__) {
const { DevSettings } = NativeModules;
DevSettings.setHotLoadingEnabled(false);
DevSettings.setLiveReloadEnabled(false);
}
For version >= 0.62:
import { DevSettings } from "react-native"
if (__DEV__) {
DevSettings._nativeModule.setHotLoadingEnabled(false);
}
For version >= 0.71:
import { NativeModules } from 'react-native';
if (__DEV__) {
NativeModules.DevSettings.setHotLoadingEnabled(false);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With