Skip to content

Commit b112b5f

Browse files
crazyshakalakaSpring Xue
andauthored
fix: picker items list is error when array is empty (#3204)
Co-authored-by: Spring Xue <[email protected]>
1 parent 0144852 commit b112b5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/picker/PickerItemsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const PickerItemsList = (props: PickerItemsListProps) => {
3636
} = props;
3737
const context = useContext(PickerContext);
3838

39-
const [wheelPickerValue, setWheelPickerValue] = useState<PickerSingleValue>(context.value ?? items?.[0].value);
39+
const [wheelPickerValue, setWheelPickerValue] = useState<PickerSingleValue>(context.value ?? items?.[0]?.value);
4040
// TODO: Might not need this memoized style, instead we can move it to a stylesheet
4141
const wrapperContainerStyle = useMemo(() => {
4242
// const shouldFlex = Constants.isWeb ? 1 : useDialog ? 1 : 1;

0 commit comments

Comments
 (0)