Skip to content

Commit fec7d5a

Browse files
committed
Fix issue wix#1052 - PickerItem ignore renderItem prop (wix#1054)
1 parent a81849a commit fec7d5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/picker/PickerItem.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const PickerItem = props => {
2929
testID
3030
} = props;
3131
const context = useContext(PickerContext);
32-
const {migrate, renderItem} = context;
32+
const {migrate} = context;
33+
const customRenderItem = context.renderItem || props.renderItem;
3334
const isSelected = isItemSelected(value, !migrate && _.isPlainObject(context.value) ? context.value.value : context.value);
3435
const itemLabel = getItemLabel(label, value, props.getItemLabel || context.getItemLabel);
3536
const accessibilityProps = {
@@ -87,7 +88,7 @@ const PickerItem = props => {
8788
throttleTime={0}
8889
{...accessibilityProps}
8990
>
90-
{renderItem ? renderItem(value, {...props, isSelected}, itemLabel) : _renderItem()}
91+
{customRenderItem ? customRenderItem(value, {...props, isSelected}, itemLabel) : _renderItem()}
9192
</TouchableOpacity>
9293
);
9394
};

0 commit comments

Comments
 (0)