@react-native-picker/picker
Advanced tools
Comparing version 2.10.1 to 2.10.2
@@ -71,6 +71,7 @@ /** | ||
React.Children.toArray(props.children).map((child, index) => { | ||
var _child$props; | ||
if (child === null) { | ||
return null; | ||
} | ||
if (child.props.value === props.selectedValue) { | ||
if ((child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.value) === props.selectedValue) { | ||
jsValue = index; | ||
@@ -103,6 +104,7 @@ } | ||
const items = React.Children.toArray(props.children).map((child, index) => { | ||
var _child$props2; | ||
if (child === null) { | ||
return null; | ||
} | ||
if (child.props.value === props.selectedValue) { | ||
if ((child === null || child === void 0 || (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.value) === props.selectedValue) { | ||
selected = index; | ||
@@ -112,3 +114,3 @@ } | ||
enabled = true | ||
} = child.props; | ||
} = child.props || {}; | ||
const { | ||
@@ -119,3 +121,3 @@ color, | ||
style = {} | ||
} = child.props; | ||
} = child.props || {}; | ||
const processedColor = (0, _reactNative.processColor)(color); | ||
@@ -152,3 +154,3 @@ return { | ||
const value = (_children$position = children[position]) === null || _children$position === void 0 || (_children$position = _children$position.props) === null || _children$position === void 0 ? void 0 : _children$position.value; | ||
if (value) { | ||
if (value !== undefined) { | ||
onValueChange(value, position); | ||
@@ -155,0 +157,0 @@ } |
@@ -65,6 +65,7 @@ /** | ||
React.Children.toArray(props.children).map((child, index) => { | ||
var _child$props; | ||
if (child === null) { | ||
return null; | ||
} | ||
if (child.props.value === props.selectedValue) { | ||
if ((child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.value) === props.selectedValue) { | ||
jsValue = index; | ||
@@ -97,6 +98,7 @@ } | ||
const items = React.Children.toArray(props.children).map((child, index) => { | ||
var _child$props2; | ||
if (child === null) { | ||
return null; | ||
} | ||
if (child.props.value === props.selectedValue) { | ||
if ((child === null || child === void 0 || (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.value) === props.selectedValue) { | ||
selected = index; | ||
@@ -106,3 +108,3 @@ } | ||
enabled = true | ||
} = child.props; | ||
} = child.props || {}; | ||
const { | ||
@@ -113,3 +115,3 @@ color, | ||
style = {} | ||
} = child.props; | ||
} = child.props || {}; | ||
const processedColor = processColor(color); | ||
@@ -146,3 +148,3 @@ return { | ||
const value = (_children$position = children[position]) === null || _children$position === void 0 || (_children$position = _children$position.props) === null || _children$position === void 0 ? void 0 : _children$position.value; | ||
if (value) { | ||
if (value !== undefined) { | ||
onValueChange(value, position); | ||
@@ -149,0 +151,0 @@ } |
@@ -114,3 +114,3 @@ /** | ||
} | ||
if (child.props.value === props.selectedValue) { | ||
if (child?.props?.value === props.selectedValue) { | ||
jsValue = index; | ||
@@ -163,9 +163,9 @@ } | ||
} | ||
if (child.props.value === props.selectedValue) { | ||
if (child?.props?.value === props.selectedValue) { | ||
selected = index; | ||
} | ||
const {enabled = true} = child.props; | ||
const {enabled = true} = child.props || {}; | ||
const {color, contentDescription, label, style = {}} = child.props; | ||
const {color, contentDescription, label, style = {}} = child.props || {}; | ||
@@ -206,3 +206,3 @@ const processedColor = processColor(color); | ||
const value = children[position]?.props?.value; | ||
if (value) { | ||
if (value !== undefined) { | ||
onValueChange(value, position); | ||
@@ -209,0 +209,0 @@ } |
{ | ||
"name": "@react-native-picker/picker", | ||
"version": "2.10.1", | ||
"version": "2.10.2", | ||
"homepage": "https://github.com/react-native-picker/picker#readme", | ||
@@ -5,0 +5,0 @@ "description": "React Native Picker for iOS, Android, macOS, and Windows", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
398357
4731