我正在使用react-native-contacts,当我试图返回一个函数时,他返回“找不到变量名”
function search(number) {
var nome = ''
Contacts.getContactsByPhoneNumber(number, (err, contacts) => {
var nome = contacts[0].familyName
console.log(nome)
return nome
})
}
console.log返回联系人的姓名,问题仅在于如何返回搜索结果。
*是的,我知道这有点新手**