Please report: Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code

Viewed 7

I'm getting the contact list from the user phone by using import * as Contacts from 'expo-contacts'; library.

When I go to the screen that gets the list of the contacts, I get this error:

Please report: Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code

To do that I'm using an useEffect:

  useEffect(() => {
    (async () => {
      const { status } = await Contacts.requestPermissionsAsync();
      console.log('status', status);
      if (status === 'granted') {
        const { data } = Contacts.getContactsAsync({
          fields: [Contacts.Fields.PhoneNumbers],
        });
        if (data.length > 0) {
          setContacts(data);
        }
      }
    })();

    AsyncStorage.getItem('Credentials')
      .then((result) => {
        if (result !== null) {
          setPhone(JSON.parse(result).phone);
          setName(JSON.parse(result).fullName);
        } else {
          setPhone(null);
        }
      })
      .catch((error) => console.log(error));

How can I solve this error?

0 Answers
Related