ElemeFE / element-react

Element UI
https://elemefe.github.io/element-react/index
MIT License
2.83k stars 444 forks source link

Table -> rowStyle does not exist #1039

Open eakarpov opened 4 years ago

eakarpov commented 4 years ago

Description

Property rowStyle in Table components does not exist

Reproduce Steps

  1. Create Table component
  2. Define rowStyle property

Error Trace (if possible)

Error:(10, 17) TS2769: No overload matches this call. Overload 1 of 2, '(props: Readonly): Table', gave the following error. Type '{ children: never[]; data: any; rowStyle: { height: string; }; defaultSort: any; className: string; height: number; emptyText: any; showHeader: any; columns: { prop: string; label: string; }[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes

& Readonly & Readonly<{ children?: ReactNode; }>'. Property 'rowStyle' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes
& Readonly & Readonly<{ children?: ReactNode; }>'. Overload 2 of 2, '(props: TableProps, context?: any): Table', gave the following error. Type '{ children: never[]; data: any; rowStyle: { height: string; }; defaultSort: any; className: string; height: number; emptyText: any; showHeader: any; columns: { prop: string; label: string; }[]; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes
& Readonly & Readonly<{ children?: ReactNode; }>'. Property 'rowStyle' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes
& Readonly & Readonly<{ children?: ReactNode; }>'.

eakarpov commented 4 years ago
interface TableProps extends ElementReactLibs.ComponentProps<{}> {
    columns?: TableColumn[]
    data?: Object[]
    height?: number
    stripe?: boolean
    border?: boolean
    fit?: boolean
    rowClassName?(row?, index?): void
    style?: Object
    highlightCurrentRow?: boolean
    onCurrentChange?(): void
    onSelectAll?(): void
    onSelectChange?(): void
  }

does not have the full list of claimed properties in docs!