-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add generic typing to table component #259
Conversation
|
||
export type { ColumnType, ExpandableConfig, ColumnsType, TableProps } | ||
|
||
export const Table = (props: ITableProps) => { | ||
export const Table = <RecordType extends AnyObject = any>(props: ITableProps<RecordType>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh boy AnyObject
that has any
as a default. That's too many any
's 😄
Jokes aside, can we do the same as Antd and use AnyObject = AnyObject
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was playing in Nancy and I found I needed this two Fridays ago. LGTM
@@ -1,17 +1,18 @@ | |||
import { Table as AntTable } from 'antd' | |||
import { type TableProps as AntTableProps } from 'antd' | |||
import { type AnyObject } from 'antd/lib/_util/type' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter if we mix imports from antd/es and antd/lib? I know this is only a type, I'm wondering how this transpiles, though. I was reading about type imports the other day and I think this transpiles to:
import { } from 'antd/lib/_util/type
This is minor, just asking if you knew how it all works, I don't really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 This PR is included in version 1.17.0-ups-configurable-cookie.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.16.2-query-select-number.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Instructions
main
Summary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)