如何从异步存储中删除项目?现在我正在try 以下代码:
AsyncStorage.removeItem('userId');
但这对我不起作用.
如何从异步存储中删除项目?现在我正在try 以下代码:
AsyncStorage.removeItem('userId');
但这对我不起作用.
试试这个:
async removeItemValue(key) {
try {
await AsyncStorage.removeItem(key);
return true;
}
catch(exception) {
return false;
}
}