Picker: cannot read property 'value' of undefined when items
is an empty array
#2936
Open
4 of 7 tasks
Labels
bug
a bug in one of the components
Description
When
items
passed to<Picker />
is an empty array (e.g. due to filtering using Search), app crashes.This is due to the fact that in
PickerItemsList.tsx
when initializingwheelPickerValue
on line38
it's assumed that ifitems
is defined, there is at least one item:an extra
?
for optional chaining will solve the issue:Workaround
Don't pass an empty array as
items
. Instead you can pass anull
for example.Related to
Steps to reproduce
Expected behavior
App doesn't crash
Actual behavior
App crashes with an error
More Info
Code snippet
Screenshots/Video
Environment
0.73.2
7.16.0
Affected platforms
The text was updated successfully, but these errors were encountered: