Я заметил, что при тестировании на моем устройстве Android с использованием Expo Go меню разработчика, запускаемое с нажатием M в терминале, предотвращает, что UI вызывает, когда он выходит на выпуск, когда он выходит на выпуск, когда он выходит на выпуск, когда он выходит на выпуск, когда он выходит на выпуск, когда он выходит на выпуск, когда он выходит на выпуск, когда он выходит на выпуск. В. Я переключал его каждый раз, но это раздражает, особенно когда я забываю.npx expo start -c
>>
Starting project at C:\PATH-INTENTIONALLY OMITTED
Starting Metro Bundler
warning: Bundler cache is empty, rebuilding (this may take a minute)
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
//QR CODE INTENTIONALLY OMITTED
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
› Metro waiting on exp://IP-INTENTIONALLY OMITTED
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)
› Using Expo Go
› Press s │ switch to development build
› Press a │ open Android
› Press w │ open web
› Press j │ open debugger
› Press r │ reload app
› Press m │ toggle menu
› shift+m │ more tools
› Press o │ open project code in your editor
› Press ? │ show all commands
Logs for your project will appear below. Press Ctrl+C to exit.
Android Bundled 21857ms node_modules\expo\AppEntry.js (1169 modules)
(NOBRIDGE) LOG Bridgeless mode is enabled
(NOBRIDGE) LOG expo-dev-menu not found or could not be disabled: [Error: Requiring unknown module "undefined". If you are sure the module exists, try restarting Metro. You may also want to run `yarn` or `npm install`.]
(NOBRIDGE) WARN [Reanimated] Reduced motion setting is enabled on this device. This warning is visible only in the development mode. Some animations will be disabled by default. You can override the behavior for individual animations, see https://docs.swmansion.com/react-native ... his-device.
INFO
(NOBRIDGE) LOG Login button pressed
› Toggling dev menu //
Я много пытался решить проблему. Как вы можете видеть из моего журнала терминала, я в настоящее время пытаюсь обнаружить меню DEV и закрыть его через мое приложение (это только частично работает, потому что меню обнаруживает, что оно было закрыто и открывается). Нажатие m в терминале исправляет проблему, но это раздражение.
Код: Выделить всё
// --- Begin hack to disable Expo Dev Menu ---
if (__DEV__) {
try {
const DevMenu = require('expo-dev-menu');
if (DevMenu) {
// If a method exists to disable it, use it:
if (typeof DevMenu.setEnabled === 'function') {
DevMenu.setEnabled(false);
console.log('Dev menu disabled via setEnabled.');
} else {
// Otherwise, override its isEnabled property.
Object.defineProperty(DevMenu, 'isEnabled', {
value: false,
configurable: true,
writable: false,
});
console.log('Dev menu disabled by overriding isEnabled.');
}
}
} catch (e) {
console.log('expo-dev-menu not found or could not be disabled:', e);
}
}
// --- End hack to disable Expo Dev Menu ---
Подробнее здесь: https://stackoverflow.com/questions/795 ... responsive
Мобильная версия