Skip to content

Commit

Permalink
chore: bump react ts def version
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed May 13, 2022
1 parent a759aec commit e4505ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"@types/classnames": "^2.2.10",
"@types/enzyme": "^3.10.5",
"@types/jest": "^25.1.3",
"@types/react": "^16.8.19",
"@types/react-dom": "^16.8.4",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/warning": "^3.0.0",
"cross-env": "^5.2.0",
"dumi": "^1.1.12",
Expand Down
11 changes: 7 additions & 4 deletions src/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type ListRef = {
scrollTo: ScrollTo;
};

export interface ListProps<T> extends React.HTMLAttributes<any> {
export interface ListProps<T> extends Omit<React.HTMLAttributes<any>, 'children'> {
prefixCls?: string;
children: RenderFunc<T>;
data: T[];
Expand Down Expand Up @@ -277,10 +277,13 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
componentRef.current.addEventListener('MozMousePixelScroll', onMozMousePixelScroll);

return () => {
if(componentRef.current) {
if (componentRef.current) {
componentRef.current.removeEventListener('wheel', onRawWheel);
componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll as any);
componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll as any);
componentRef.current.removeEventListener(
'MozMousePixelScroll',
onMozMousePixelScroll as any,
);
}
};
}, [useVirtual]);
Expand Down Expand Up @@ -381,5 +384,5 @@ const List = React.forwardRef<ListRef, ListProps<any>>(RawList);
List.displayName = 'List';

export default List as <Item = any>(
props: React.PropsWithChildren<ListProps<Item>> & { ref?: React.Ref<ListRef> },
props: ListProps<Item> & { ref?: React.Ref<ListRef> },
) => React.ReactElement;

1 comment on commit e4505ca

@vercel
Copy link

@vercel vercel bot commented on e4505ca May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.