简体   繁体   English

如何在 React Native flatlist 中访问数组中的嵌套对象

[英]How to access nested objects in an array in react native flatlist

Please how do i access the value of date which is inside _embedded in a nested array like this:请我如何访问_embedded在嵌套数组中的date值,如下所示:

[{"id":970,

"title":"Mojekwu v Mojekwu: Facts, Issues & Decision of Court",

"url":"https:\/\/bscholarly.com\/mojekwu-v-mojekwu\/",

"type":"post","subtype":"post",

"_links":{"self":[{"embeddable":true,"href":"https:\/\/bscholarly.com\/wp-json\/wp\/v2\/posts\/970"}],

"about":[{"href":"https:\/\/bscholarly.com\/wp-json\/wp\/v2\/types\/post"}],

"collection":[{"href":"https:\/\/bscholarly.com\/wp-json\/wp\/v2\/search"}]},

"_embedded":{"self":[{"id":970,"date":"2020-08-01T08:55:39","slug":"mojekwu-v-mojekwu",

"type":"post","link":"https:\/\/bscholarly.com\/mojekwu-v-mojekwu\/",

"title":{"rendered":"Mojekwu v Mojekwu: Facts, Issues & Decision of Court"},
]

I am using a flatlist to display them.我正在使用平面列表来显示它们。 And I have tried item._embedded.date but that did not work for me.我已经尝试过item._embedded.date但这对我不起作用。

Please help me out.请帮帮我。

This is the API link. 是 API 链接。

尝试这个

_embedded.self[0].date

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何访问 React Native ```FlatList``` 中对象数组内的数组? - How do I access an array inside an array of objects in a React Native ```FlatList```? React Native Flatlist 嵌套循环 - React Native Flatlist nested loop flatlist 不呈现对象数组 [React-Native] [Firebase] - flatlist is not rendering array of objects [React-Native] [Firebase] 如何使用反应原生 AsyncStorage 将 JS 对象保存在数组中并显示在平面列表中 - How to save JS objects in array using react native AsyncStorage and display in a Flatlist 如何从 react-native 中的嵌套对象访问 this.state? - How to access this.state from nested objects in react-native? 如何在带有本机反应的平面列表中显示 object 数组中的数组列表? - How to display a list of array in a object array in a flatlist with react native? 在 React Native 中映射嵌套的对象数组 - Mapping a nested array of objects in React Native 如何使用 map 在 react native 而不是 FlatList 中获取 JSON 数据对象。 ScrollView 在 FlatList 中不起作用 - How to use map to fetch JSON data objects in react native instead of FlatList. ScrollView is not working in FlatList 如何在 React Native 中通过 TextInput 访问对象数组中的数据 - How to access the data from an array of objects by TextInput in react native 如何在React Native中为Flatlist数组中的单个项目设置动画 - How to animate a single item from Flatlist array in React Native
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM