‘UI-Kitten’ Select Component not rendering value

You should refer the documentation https://akveo.github.io/react-native-ui-kitten/docs/components/select/overview#select

The select component doenst have a value prop, it has a selectedIndex props which will chose the item on the given index.

In your case you can do something like this

<Select
style={styles.inputView}
value={props.values.gender}
placeholder='Gender'
onSelect={item => props.setFieldValue(
'gender', item.row == 0 ? 'Male' : 'Female'
)}
>
<SelectItem title='Male' />
<SelectItem title='Female' />
</Select>

Based on the state value you can find the index and vise versa. This will make sure that Select always getting an index value and your state always having a string.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top