From e9df687df5950c9bb211a5bb0e1aaceac1f2a9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 28 Mar 2019 18:55:52 +0800 Subject: [PATCH] better ts type --- components/list/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/list/index.tsx b/components/list/index.tsx index 9510222add..0adeaf42af 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -31,11 +31,11 @@ export type ListSize = 'small' | 'default' | 'large'; export type ListItemLayout = 'horizontal' | 'vertical'; -export interface ListProps { +export interface ListProps { bordered?: boolean; className?: string; children?: React.ReactNode; - dataSource: any; + dataSource: T[]; extra?: React.ReactNode; grid?: ListGridType; id?: string; @@ -57,7 +57,7 @@ export interface ListLocale { emptyText: React.ReactNode | (() => React.ReactNode); } -export default class List extends React.Component { +export default class List extends React.Component> { static Item: typeof Item = Item; static childContextTypes = { @@ -70,7 +70,7 @@ export default class List extends React.Component { bordered: false, split: true, loading: false, - pagination: false as ListProps['pagination'], + pagination: false as ListProps['pagination'], }; state = {