react-native-contacts icon indicating copy to clipboard operation
react-native-contacts copied to clipboard

Update types for contact fields that may be null

Open thisjeremiah opened this issue 1 year ago • 1 comments

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.

thisjeremiah avatar May 11 '24 04:05 thisjeremiah

@thisjeremiah please submit a pr updating the typings

morenoh149 avatar May 21 '24 16:05 morenoh149

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.

atheck avatar Jul 08 '24 06:07 atheck

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

morenoh149 avatar Aug 13 '24 15:08 morenoh149

I know this is a closed ticket, but shouldn't the type.ts also be updated with this change?

gimi-anders avatar May 23 '25 11:05 gimi-anders