0
Good I’m having a problem when I will save some data in Asyncstorage, when I will return it comes null.
salvage :
export const listarRecados = () => {
return dispatch => {
firebase.database().ref('/Recados/')
.on('value', recados => {
var recado = {};
$.forEach(recados.val(), (recados, recID) => {
firebase.database().ref('/Equipe/').child(recados.enviadoPorId)
.once('value', equipe => {
enviadoPor = equipe.val()
recado[recID] = {...recados, recID, ...enviadoPor}
})
})
AsyncStorage.setItem('Recados', JSON.stringify(recado));
dispatch({ type: LISTAR_RECADOS, payload: recado })
})
}
};
return:
AsyncStorage.getItem('Recados', (erro, resultado) => {
console.log(">>>", resultado)
});
it returns null
Apparently everything is correct, what happens when you re-export this code, keeps returning null ? According to the React Native documentation, getItem() returns null in callback when there is no value for that key
– Pedro Neri
Peter, so for some reason the setItem not this salvage will be that there is something wrong because before it appeared normal now stopped after I added the team search.
– Igor Scheffer Ferreira