Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Argument of type '{ [x: string]: any; }' is not assignable to parameter of type 'Contact'

$
0
0

ErrorArgument of type '{ [x: string]: any; }' is not assignable to parameter of type 'Contact'.Type '{ [x: string]: any; }' is missing the following properties from type 'Contact': id, contactType, name ts(2345)

const contact: {    [x: string]: any;}

I have a problem with this error. I'm trying to download a contact in my expo app.

My Code download.tsx:

const downloadContact = async (customer: any) => {    if(hasContactPermission) {        const contact = {            [Contacts.Fields.Name]: customer.name,            [Contacts.Fields.Emails]: customer.email,            [Contacts.Fields.PhoneNumbers]: customer.phone,        };        const contactId = await Contacts.addContactAsync(contact);    }}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>