I'm getting the keys returned (0,1..) but can not access the value of _text This is my data, of type object the IdList is an object : IdList: {Id: Array(6)} I'm having the keys but can not access the value of _text
IdList: {Id: Array(6)}
Id: Array(6)
0: {_text: '34983115'}
1: {_text: '34983114'}
2: {_text: '34983113'}...
query
{_declaration: {…}, _doctype: '', eSearchResult: {…}}
eSearchResult:
Count: {_text: '203374'}
IdList:
Id: Array(6)
0: {_text: '34983115'}
1: {_text: '34983114'}
2: {_text: '34983113'}
3: {_text: '34983112'}
4: {_text: '34983111'}
5: {_text: '34983110'}
length: 6
[[Prototype]]: Array(0)
[[Prototype]]: Object
I stored the data in an object state named query
const [query, setQuery] = useState({});
Then tried to access the id in the idlist: the output of this code is index , index._text is undefined
{Object.keys(query).length &&
Object.keys(query.eSearchResult.IdList.Id).map((keyName, index) => {
return (
<div className="card bg-c-blue order-card">
<div className="card-block" keyy={index}>
{index}
{index._text}
</div>
</div>
);
})}