Hi everyone
I am having trouble that's when I use RenderListItem to customize the list item, I can't click on item in that list, But I can do it on a normal list (without renderlist)
I don't know why
Hope everyone can help me
Thanks
this is my code
/// my state
const [openAgency, setOpenAgency] = useState(false);
const [agencyValue, setAgencyValue] = useState<string | null>(null);
const [agency, setAgency] = useState(DATA_AGENCY);
/// render item
const Item = (props: any) => {
return (
<View style={[styles.containerItem]} key={props.item}>
<Text style={styles.agencyName}>
{props.item.value}
</Text>
<Text style={styles.addressName}>
{props.item.address}
</Text>
</View>
)
}
/// dropdown list
<DropDownPicker
open={openAgency}
value={agencyValue}
items={agency}
setOpen={setOpenAgency}
setValue={setAgencyValue}
setItems={setAgency}
listMode="SCROLLVIEW"
style={styles.inputDistrict}
containerStyle={{
width: "100%",
}}
placeholder="Select an Agency"
selectedItemContainerStyle={{
backgroundColor: "#84E5FF",
}}
listItemLabelStyle={{
color: "#00355A"
}}
selectedItemLabelStyle={{
color: "#00355A"
}}
dropDownContainerStyle={{
marginTop: 4,
borderRadius: 10
}}
onSelectItem={(item) => {
console.log(item);
}}
renderListItem={(props) => <Item {...props} />}
zIndex={100}
/>