How can I convert this JSON into an array for JSX (React Native)?

{"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}]}


I need to turn into an array

JSON.stringify can't cope with that.
March 23rd 20 at 19:12
2 answers
March 23rd 20 at 19:14
JSON.stringify - used for other purposes, this method converts the data to a JSON string.

Property response and so is an array. You just have to turn to him.

If the data you need to parse(which I someways) then you should use the method JSON.parse
March 23rd 20 at 19:16
const response = JSON.parse('{"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}]}');
const responseData = response.response;

Find more questions by tags React NativeJavaScript