Changeset View
Changeset View
Standalone View
Standalone View
native/dev-menu.js
- This file was added.
// @flow | |||||
import { registerDevMenuItems } from 'expo-dev-menu'; | |||||
import { filesystemMediaCache } from './media/media-cache.js'; | |||||
// see https://docs.expo.dev/develop/development-builds/development-workflows/#extending-the-dev-menu | |||||
// for details on extending the dev menu | |||||
if (__DEV__) { | |||||
const devMenuItems = [ | |||||
{ | |||||
name: 'Clear media cache', | |||||
callback: async () => { | |||||
try { | |||||
await filesystemMediaCache.clearCache(); | |||||
alert('Media cache cleared'); | |||||
ashoat: This isn't mentioned in the link above – wondering, how does `alert` work in Expo / React… | |||||
bartekAuthorUnsubmitted Done Inline ActionsThis display system native message box. The same kind of alert pops up massively when logging in/out saying that redux/database was cleared/hydrated etc. bartek: This display system native message box. The same kind of alert pops up massively when logging… | |||||
} catch { | |||||
alert('Cache clear failed'); | |||||
} | |||||
}, | |||||
}, | |||||
]; | |||||
registerDevMenuItems(devMenuItems); | |||||
} |
This isn't mentioned in the link above – wondering, how does alert work in Expo / React Native? Is this an alias for react-native's Alert component, or is it something specific to expo-dev-menu / registerDevMenuItems? (I figure the latter since you mentioned a "toast")