-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
Labels
buga bug in one of the componentsa bug in one of the components
Description
Describe the bug
While using the Picker of this library I get the following warning every-time
To Reproduce
- Creating a basic Picker
- Having a list of object, each object like so:
{key: '..', label: '...', value: '...'} - Creating a list of
Picker.Itemby maping my list of object. Without lodash library, just the standard JS map function
Expected behavior
The picker is actually working, but i can't find why it is sending me this warning everytime. I checked the code here, and it seems i did the same except for lodash use and the key prop added to each object.
Code snippet
<Picker
ref={ref}
title={`${props.label}Picker`}
floatingPlaceholder
// migrate={true}
placeholder={props.placeholder}
value={props.value}
onChange={props.onValueChange}
floatingPlaceholderStyle={{
...Typography.normal,
fontSize: 16,
color: Colors.placeholder,
// marginLeft: Spacings.S - 3,
}}
style={[
{
...Typography.normal,
color: Colors.text,
top: props.label ? -8 : 0,
paddingBottom: 15,
paddingTop: 5,
textAlign: props.label ? 'right' : 'left',
},
props.label && { width: '50%' },
]}
renderRightIcon={() => (
<TouchableOpacity
onPress={ref?.current?.toggleExpandableModal}
>
<Text>Toggle</Text>
</TouchableOpacity>
)}
hideUnderline
useNativePicker={!props.search}
showSearch={props.search}
wheelPickerProps={{
items: props.items,
textStyle: {
fontSize: 15,
},
}}
>
{props.items.map((option) => (
<Picker.Item
key={option.key}
value={option.value}
label={option.label}
inputLabel={option.inputLabel ?? undefined}
disabled={false}
labelStyle={{
...Typography.title,
color: Colors.primary,
}}
selectedIconColor={Colors.highlight}
/>
))}
</Picker>HERE is what I pass to my items props when using my custom component using the picker
items={itemsFromSomwhere.map((m) => ({
value: m,
label: m,
key: m,
}))}Screenshots
Device (please complete the following information)
IOS Emulator: Iphone 8
Additional context
Metadata
Metadata
Assignees
Labels
buga bug in one of the componentsa bug in one of the components
