Hello im new to react native and i want to save datas in my mobile locale storage, I use async storage for storing the data, the data that im sending is an object and i want to store it in an array. So the data that i have been created will store permanently in an Array.
This is the data that i sent
const createMessage = () => {
const formData = {
judul,
deskripsi,
startDate,
endDate,
type
};
storeMessage(formData)
};
this is the storage and how to get the data
export const storeMessage = async (value) => {
try {
const jsonValue = JSON.stringify(value)
await AsyncStorage.multiSet('MESSAGE_DATA', [jsonValue])
} catch (e) {
// saving error
}
}
export const getMessage = async () => {
try {
const jsonValue = await AsyncStorage.getItem('MESSAGE_DATA')
jsonValue != null ? JSON.parse(jsonValue) : null;
console.log('value', jsonValue)
return jsonValue
} catch (e) {
// error reading value
}
}
And the getMessage return this data {"_U": 0, "_V": 0, "_W": null, "_X": null}
How should I call my storage data