Skip to content

Commit

Permalink
fix(List): item type validation (#949)
Browse files Browse the repository at this point in the history
Co-authored-by: Yevhenii Chernovol <[email protected]>
  • Loading branch information
imechoim and imechoim authored Aug 24, 2023
1 parent 28c6c1e commit 1aef5b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React from 'react';

import isObject from 'lodash/isObject';
import {SortableContainer, SortableElement} from 'react-sortable-hoc';
import AutoSizer, {Size} from 'react-virtualized-auto-sizer';
import {VariableSizeList as ListContainer} from 'react-window';
Expand Down Expand Up @@ -211,7 +212,7 @@ export class List<T = unknown> extends React.Component<ListProps<T>, ListState<T
private renderItemContent: ListItemProps<T>['renderItem'] = (item, isItemActive, itemIndex) => {
const {onLoadMore} = this.props;

if ('value' in item && item.value === this.loadingItem.value) {
if (isObject(item) && 'value' in item && item.value === this.loadingItem.value) {
return (
<SelectLoadingIndicator onIntersect={itemIndex === 0 ? undefined : onLoadMore} />
);
Expand Down

0 comments on commit 1aef5b5

Please sign in to comment.