Answer the question
In order to leave comments, you need to log in
How to write such JSON to AsyncStorage (React Native)?
Here is an array I get through axios
{"response":[{"id":"1","cat_id":"1","title":"\u041f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u043f\u0438\u0442\u0430\u043d\u0438\u044f","get_catalog":"campony_ru","language":"1","visible":null},{"id":"2","cat_id":"2","title":"\u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0438 \u0440\u0435\u043c\u043e\u043d\u0442","get_catalog":"campony_ru","language":"1","visible":null},{"id":"3","cat_id":"3","title":"\u041e\u0434\u0435\u0436\u0434\u0430 \u0438 \u043e\u0431\u0443\u0432\u044c","get_catalog":"campony_ru","language":"1","visible":null},{"id":"4","cat_id":"4","title":"\u0414\u0435\u0442\u0441\u043a\u0438\u0435 \u0438\u0433\u0440\u0443\u0448\u043a\u0438","get_catalog":"campony_ru","language":"1","visible":null}]}
Answer the question
In order to leave comments, you need to log in
Simple example:
const { data } = await axios.get('/someUrl');
await AsyncStorage.setItem('somekey', JSON.stringify(data.response));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question