如果第一个选择器选择了某项,我想显示隐藏的选择器。
选择器更改时如何显示某些组件
{
this.state.showme ?
<View>
<Picker
selectedValue={this.state.PickerClearance}
style={styles.pickercont}
onValueChange={handlePickerChange}>
{/* onValueChange={(itemValue, itemIndex) => this.setState({ PickerClearance: itemValue })}> */}
<Picker.Item label='Certificate Type' value='0' />
<Picker.Item label="Barangay Certificate" value="barangay certificate" />
<Picker.Item label="Barangay Clearance" value="barangay clearance" />
</Picker>
</View>
:
<View>
<Picker
selectedValue={this.state.PickerClearance}
style={styles.pickercont}
onValueChange={(itemValue, itemIndex) => this.setState({ PickerClearance: itemValue })}>
<Picker.Item label='Type of Certificates' value='0' />
<Picker.Item label="Barangay Certificate" value="barangay certificate" />
<Picker.Item label="Barangay Clearance" value="barangay clearance" />
</Picker>
</View>
}