Skip to content

Commit e4505ca

Browse files
committed
chore: bump react ts def version
1 parent a759aec commit e4505ca

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"@types/classnames": "^2.2.10",
4646
"@types/enzyme": "^3.10.5",
4747
"@types/jest": "^25.1.3",
48-
"@types/react": "^16.8.19",
49-
"@types/react-dom": "^16.8.4",
48+
"@types/react": "^18.0.0",
49+
"@types/react-dom": "^18.0.0",
5050
"@types/warning": "^3.0.0",
5151
"cross-env": "^5.2.0",
5252
"dumi": "^1.1.12",

src/List.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type ListRef = {
3737
scrollTo: ScrollTo;
3838
};
3939

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

279279
return () => {
280-
if(componentRef.current) {
280+
if (componentRef.current) {
281281
componentRef.current.removeEventListener('wheel', onRawWheel);
282282
componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll as any);
283-
componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll as any);
283+
componentRef.current.removeEventListener(
284+
'MozMousePixelScroll',
285+
onMozMousePixelScroll as any,
286+
);
284287
}
285288
};
286289
}, [useVirtual]);
@@ -381,5 +384,5 @@ const List = React.forwardRef<ListRef, ListProps<any>>(RawList);
381384
List.displayName = 'List';
382385

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

0 commit comments

Comments
 (0)