Skip to content
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

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Fix type extension #448

merged 1 commit into from
Aug 31, 2023

Conversation

b1rdex
Copy link
Contributor

@b1rdex 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 {
                   ~~~~~~~~~~~~~~~

```
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 {
                   ~~~~~~~~~~~~~~~
```
@vercel
Copy link

vercel bot commented Jul 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rsuite-table ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2023 11:44am

@codesandbox-ci
Copy link

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:

Sandbox Source
React Configuration
Vanilla Configuration

@@ -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'> {
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonguo any update?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonguo simonguo merged commit a8c9246 into rsuite:main Aug 31, 2023
6 checks passed
@b1rdex b1rdex deleted the patch-1 branch August 31, 2023 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants