[英]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.请帮帮我。
尝试这个
_embedded.self[0].date
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.