-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Fix type extension #448
Fix type extension #448
Conversation
b1rdex
commented
Jul 25, 2023
``` node_modules/rsuite-table/lib/HeaderCell.d.ts:4:18 - error TS2430: Interface 'HeaderCellProps' incorrectly extends interface 'InnerCellProps'. Types of property 'onResize' are incompatible. Type '((columnWidth?: number | undefined, dataKey?: string | undefined) => void) | undefined' is not assignable to type 'ReactEventHandler<HTMLElement> | undefined'. Type '(columnWidth?: number | undefined, dataKey?: string | undefined) => void' is not assignable to type 'ReactEventHandler<HTMLElement>'. Types of parameters 'columnWidth' and 'event' are incompatible. Type 'SyntheticEvent<HTMLElement, Event>' is not assignable to type 'number'. 4 export interface HeaderCellProps extends InnerCellProps { ~~~~~~~~~~~~~~~ ```
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit fd8218f:
|
@@ -9,7 +9,7 @@ import ColumnResizeHandler, { FixedType } from './ColumnResizeHandler'; | |||
import { useUpdateEffect, useClassNames } from './utils'; | |||
import Cell, { InnerCellProps } from './Cell'; | |||
|
|||
export interface HeaderCellProps extends InnerCellProps { | |||
export interface HeaderCellProps extends Omit<InnerCellProps, 'onResize'> { |
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.
But there is no definition of onResize
in InnerCellProps
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.
Yes, it's in the React: React.DOMAttributes<T>.onResize?: ReactEventHandler<T> | undefined
.
interface StandardProps extends React.HTMLAttributes<HTMLElement>
inherits that method
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.
@simonguo any update?
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.
Fixed in [email protected]