Javascript 如何在react native中禁用数组响应值上的按钮

Javascript 如何在react native中禁用数组响应值上的按钮,javascript,reactjs,react-native,ecmascript-6,Javascript,Reactjs,React Native,Ecmascript 6,这里是我的代码。IdentificationType是所有值都存在的数组。现在我必须禁用下面的按钮 CustomButton:条件(如果强制):true,上载状态:false 我尝试了一些东西,但没有得到结果 disabled={(!this.state.IdentificationType.uploadStatus == false)&&(this.state.IdentificationType.mandatory===true) } const {Identificat

这里是我的代码。IdentificationType是所有值都存在的数组。现在我必须禁用下面的按钮 CustomButton:条件(如果强制):true,上载状态:false

我尝试了一些东西,但没有得到结果

disabled={(!this.state.IdentificationType.uploadStatus == false)&&(this.state.IdentificationType.mandatory===true)  }

const {IdentificationType}= this.state;
IdentificationType (3) [{…}, {…}, {…}]
0:
idType: "POID"
name: "Proof Identity"
description: "Upload your identity proof"
mandatory: true
eligibleDocumentList: (3) [{…}, {…}, {…}]
__typename: "IdentificationTypes"
doctype: (3) [{…}, {…}, {…}]
selectValue: "passport"
issueDate: "25/02/2020"
expDate: "25/02/2020"
idNumber: ""
place: ""
image: ""
uploadStatus: false
displayThumbnail: false
fileName: ""
__proto__: Object
1: {idType: "addressProof", name: "Address Proof", description: "Upload your address proof", mandatory: false, eligibleDocumentList: Array(3), …}
2: {idType: "ageProof", name: "Age Proof", description: "Upload your age proof", mandatory: false, eligibleDocumentList: Array(3), …}
length: 3


<View style={{ alignSelf: 'center', paddingTop: 20, position: 'absolute', bottom: 10, zIndex: 10 }}>
                    <CustomButton backgroundColor={parentStyle[appliedTheme] ? parentStyle[appliedTheme][appliedMode].primaryButtonColor : null}
                        width={deviceWidth - 30} label={'Save & Proceed'} height={60} labelFontSize={hp('2.5%')}
                        disabled={true}
                        onPress={() => this.nextStep()} >
                    </CustomButton>
                </View>
disabled={(!this.state.IdentificationType.uploadStatus==false)&(this.state.IdentificationType.mandatory==true)}
const{IdentificationType}=this.state;
标识类型(3)[{…},{…},{…}]
0:
idType:“POID”
名称:“证明身份”
描述:“上传您的身份证明”
强制性:正确
合格文件清单:(3)[{…},{…},{…}]
__typename:“IdentificationTypes”
doctype:(3)[{…},{…},{…}]
选择值:“passport”
发布日期:“2020年2月25日”
扩展日期:“25/02/2020”
idNumber:“
地点:“
图像:“
上载状态:false
显示缩略图:false
文件名:“
__原型:对象
1:{idType:“地址证明”,名称:“地址证明”,说明:“上传您的地址证明”,必填项:false,eligibleDocumentList:Array(3),…}
2:{idType:“年龄证明”,名称:“年龄证明”,描述:“上传您的年龄证明”,必填项:false,eligibleDocumentList:Array(3),…}
长度:3
this.nextStep()}>
{/*返回前*/}
让{IdentificationType}=this.state;
{/*在呈现方法中*/}
{IdentificationType&&IdentificationType.map(函数(值)){
})}

使用map函数编写完整的代码。我需要知道你是如何从数组中访问数据的。IdentificationType是一个数组,它的值是多少我已经写了上面的代码,在我的代码中有一些输入字段和按钮,我必须在该密码上禁用该按钮,我可以如何做,请建议谢谢你的时间,但是如果我用这个按钮,getitng消失了吗
{/* before return */}
let {IdentificationType} = this.state;
{/* in render method */}
{IdentificationType && IdentificationType.map(function(value){
    <CustomButton disabled={value.mandatory === true && value.uploadStatus === false ? true : false}></CustomButton>
})}