Я пытаюсь заполнить раскрывающийся список с помощью Json Response, но получаю сообщение об ошибке
Не могу прочитать метку свойства undefined
Я использую реакцию библиотеки -native-dropdown-picker
CorporateCheque. js
fetch('http://192.168.1.16:1027/api/transaction/ListOfValuesForProducts',
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer ' + asyncAT
},
body: JSON.stringify({
"UserID": asyncUserID,
"Token": token,
"SessionID": asyncUS,
"ProductCode": productCode,
"DebitAccount": "",
"CustomerRefNo": null,
"PhoneNo": "",
"CNICNo": "",
"TransactionAmount": "",
"EmailAddress": "",
"BeneName": "",
"BeneAddress": "",
"DeliverTO": "",
"PrintLocation": "",
"ReferenceDetail1": "",
"ReferenceDetail2": "",
"BankCode": "",
"CreditAccount": ""
}),
})
.then((response) => response.json())
.then((responseJson) => {
var responseCode = CryptoED.decryptData(responseJson.ResponseCode);
var responseMessage = CryptoED.decryptData(responseJson.ResponseMessage);
if (responseCode == "00") {
setDeliverToList(responseJson.Response.DeliverToList) //Using Hooks
setDebitAccList(responseJson.Response.DebitAccList)
setPrintLocList(responseJson.Response.PrintLocList)
}
else {
showToastWithGravity(responseMessage);
}
})
.catch((error) => {
setIsLoading(false);
console.log(error.message);
showToastWithGravity(error.message);
});
<DropDownPicker style={styles.Dropdown}
items={
deliverToList != null ? (
deliverToList.map((itemDT) => (
[
{ label: CryptoED.decryptData(itemDT.DeliverToName), value: CryptoED.decryptData(itemDT.DeliverToCode) },
]
)
)
) : null
}
// defaultValue={deliverToList}
placeholder='Deliver To'
labelStyle={styles.DropdownLabel}
arrowSize={25}
arrowColor={"#116239"}
containerStyle={{ height: 70 }}
onChangeItem={item => setDeliverToList(item.value)}
/>
JSON Ответ .
{
"ResponseCode": "a/BVnDepR3Wo7B+a1rbb5g==",
"ResponseMessage": "",
"ResponseTime": "",
"Response": {
"TransactionBehavior": "ZjD1fZ4M/IdWlYRUyt9SuA==",
"DebitAccList": [
{
"AccountNumber": "iN2MnDg/VdTDulYn8uW6YA==",
"AccountName": "n9Y+VvYnhqmpDIsZpUMiJg=="
}
],
"PrintLocList": [
{
"PrintLocationCode": "rgCJ8nJcxtt7GsCGb400mg==",
"PrintLocationName": "Gu1NkcFB6jscsQ2WhpIOvg=="
},
{
"PrintLocationCode": "FP9Ub44gJoKn7Ykr+Szn2w==",
"PrintLocationName": "aHBkTYi21RdmOgWPBVQOPUGJD34PPjrnoFQtql7xNzM="
},
{
"PrintLocationCode": "mRfWFwB9DET2PyE5Bf7N4Q==",
"PrintLocationName": "K7snXHYNkc6VbRUzuBpFjw=="
},
{
"PrintLocationCode": "rpBPFcJZcGH6peVLAuCu5g==",
"PrintLocationName": "PQKoLRBfNoHARclBaP7HpA=="
},
{
"PrintLocationCode": "WBxAtmmsjFlOywpRL7yu1A==",
"PrintLocationName": "q6bvfykuEy0Q2mrxaYU8+GLxof9xY764R6Hl9XLJmPY="
}
],
"DeliverToList": [
{
"DeliverToCode": "a3O5OlxE8eKuY1yTaX1Y6g==",
"DeliverToName": "nNVeFNPuMFF9e2TE8nJTaGZirN9zMxTf9SsLRbW5Qxk="
},
{
"DeliverToCode": "6FXHx1kJ2D/CmiBNy+2scQ==",
"DeliverToName": "n9IuZoAJjuNpTSYWyfTI0OAcNRprIt0UjXpjGYmg6nw="
},
{
"DeliverToCode": "6RAax0+RMRJnbF4PbQk3xw==",
"DeliverToName": "g288NnvhB9hunnvKXe0K0g=="
}
],
"BankList": [
null
]
},
"ResponseAuthType": "",
"UserSession": ""
}