Skip to content

Commit 716b816

Browse files
authored
fix: [Android] fixed index with null child (#174)
1 parent 9d01b80 commit 716b816

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

js/PickerAndroid.android.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ class PickerAndroid extends React.Component<
6767
props: PickerAndroidProps,
6868
): PickerAndroidState {
6969
let selectedIndex = 0;
70-
const items = React.Children.map(props.children, (child, index) => {
71-
if (child === null) {
72-
return;
73-
}
70+
const items = React.Children.toArray(props.children).map((child, index) => {
7471
if (child.props.value === props.selectedValue) {
7572
selectedIndex = index;
7673
}

0 commit comments

Comments
 (0)