Reputation: 41
I am trying to call an async function in a customer flatlist view, but I am get errors caused by using await in the custom flatlist view:
async _customFlatlistView(item){
promise = await SomeFunction();
promise2 = await SomeOtherFunction();
}
Upvotes: 0
Views: 152
Reputation: 5460
The await
keyword can only be used in adding the async
keyword to the method signature:
async _customFlatlistView(item){
promise = await SomeFunction();
promise2 = await SomeOtherFunction();
}
Upvotes: 0
Reputation: 2574
await
can only be used in async
functions
_customFlatlistView = async item => {
promise = await SomeFunction()
promise2 = await SomeOtherFunction()
}
Upvotes: 1