Alert.alert AlertManager with exception of parameters

I am trying to figure out this error message:

Exception '- [_ NSDisctionary0 length]: an unrecognized selector sent to instance 0x78964120' was thrown when calling alerWithArgs in the target AlertManager with parameters

It comes from my line of code:

const response.error = 'bad credentials' Alert.alert('Login error', response.error, [{ text: 'Ok' }]) 

Even when I copy / paste from the Facebook documentation, I get an error message:

 Alert.alert( 'Alert Title', 'My Alert Msg', [ {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, {text: 'OK', onPress: () => console.log('OK Pressed')}, ] ) 

The component is imported and everything that is obvious from the error message. I think so.

Has anyone come across this? Not sure what to do with it?

+5
source share
1 answer

it's very late for this user, but adding it here, in case someone finds it useful.

managed to cause this problem by creating a warning in expo without a message, it just had a title and buttons.

This caused the error mentioned above, and not only that, in fact, it broke the exhibition and made every other warning fall as well as the same question that the poster had. I had to close the expo application completely, and not just restart and, of course, add an empty message for the message.

+9
source

Source: https://habr.com/ru/post/1263595/


All Articles