morenoh149 / react-native-contacts

React Native Contacts
MIT License
1.65k stars 564 forks source link

Update types for contact fields that may be null #737

Closed thisjeremiah closed 2 months ago

thisjeremiah commented 6 months ago

It seems that givenName and familyName could be null for fetched contacts on Android devices. This possibility is not reflected in the current TS types.

This scenario can be reproduced by creating a contact with no name and only an "important date" (eg birthday) on Android.

If this doesn’t seem like a bug in the implementation, I can make a PR to update the typings for these fields.

morenoh149 commented 6 months ago

@thisjeremiah please submit a pr updating the typings

atheck commented 4 months ago

Hi, thank you for your work! I want to mention that birthday can also be undefined. And on Android there is an option to not enter the year of the birthday. Maybe this should then be a number | null.

morenoh149 commented 3 months ago

@atheck sounds right. Feel free to submit a PR.