Open johanninos opened 3 years ago
In current version the following code with typescript would get error
const columns = { props: 'amount', title: 'amount', render: (row?: SymbolWithQuotation) => ( //blablabla ) } const data: SymbolWithQuotation[] = [...some data]; <Table columns={columns} data={data} />
ts error:
属性“render”的类型不兼容。 不能将类型“(row?: SymbolWithQuotation | undefined) => JSX.Element”分配给类型“(data?: Object | undefined, column?: Object | undefined, index?: number | undefined) => void”。 参数“row”和“data” 的类型不兼容。 不能将类型“Object | undefined”分配给类型“SymbolWithQuotation | undefined”。 .........others details
Add a generics to replace the data?: Object | undefined to fix it
Please makes sure these boxes are checked before submitting your PR, thank you!
master
npm test
npm run lint
npm run build
Changes in this pull request
In current version the following code with typescript would get error
ts error:
Add a generics to replace the data?: Object | undefined to fix it
Please makes sure these boxes are checked before submitting your PR, thank you!
master
branch.npm test
,npm run lint
andnpm run build
.Changes in this pull request