Can anyone please help me on this? I'm using UI-Kitten's select and selectiem components, and I need to know how can I bind an object to a SelectedItem component?
I would like to pass some value as a binding object:
data={
(['OPT1', 'Option 1'],
['OPT2', 'Option 2'],
['OPT3', 'Option 3'],
['OPT4', 'Option 4'],
['OPT5', 'Option 5'])
}
Then, I'll like to render each select's option with something like this:
const renderOption = (title: string, key: string) => (
<SelectItem title={title} key={key} />
);
This option could be populated with a map function:
<Select
style={styles.inputSetting}
textAlign="right"
size="small"
placeholder={placeholder}
value={value}>
{data && data.map(renderOption)}
</Select>
This won't work because map function expects (value: never, index: number), and SelectItem component doesn't have a "key" prop.
I would need to get the key value and not the display value.
Any help pointing me to the correct direction would be appreciated.