Similar to Access React Context outside of render function but I am looking to add a way of extending Alert.alert
so that it will use the color scheme from theme.
const { colorScheme } = useTheming();
...
Alert.alert(t`logout`, "Are you sure you want to logout?", [
{
text: "No",
},
{
style: "destructive",
text: "Yes",
onPress: logoutAsync,
},
], {
userInterfaceStyle: colorScheme
});
I just want it so that the color scheme does not need to be added in.
I started with
import { Alert as RNAlert } from 'react-native'
export class Alert implements RNAlert {
static alert(...) {
// how do I get the data from the context?
}
static prompt(...) {
}
}