Closed c-goettert closed 1 year ago
Perhaps I should add that we do not manually set a "-1" value as a prop. Basically, our component looks like this: We store the selected index in the component state and pass this state back as value prop to the wheel picker, like this:
...
onItemSelected = (selectedIndex) => {
this.setState({ selectedIndex })
}
...
render () {
const { items, label, unit, containerStyle, compactLayout } = this.props
return (
<WheelPicker
selectedIndex={this.state.selectedIndex}
options={items}
onChange={this.onItemSelected}
visibleRest={compactLayout ? 1 : undefined}
itemHeight={ITEM_HEIGHT}
itemTextStyle={styles.itemText}
/>
)
}
...
Never mind - I suspect the error was in our implementation, in which the default or initial value was -1 in some cases. Therefore, I close the issue.
Also after upgrading to 0.6.0 we are still seeing some occasional occurrences of index out of bounds exceptions in our crash reporting. I was unable to reproduce it myself during testing, but perhaps the corresponding error can be deliberately captured or stabilized even further?
Here is a part of the Stacktrace of a native crash (Android 10, HUAWEI HUAWEI P30 lite):
And here is the crash message of a JS crash (Android 13, Samsung Galaxy S20):
Selected index -1 is out of bounds [0, 23]
We are currently using RN 0.70.7.
Might be related to #36 .