react-component / picker

📅 All Date Pickers you need.
https://picker.react-component.now.sh/
MIT License
275 stars 315 forks source link

TypeScript error in SinglePickerPanelProps interface during build process #764

Open chaiwei opened 7 months ago

chaiwei commented 7 months ago

Reproduction link

Edit SinglePickerPanelProps

Steps to Reproduce:

What is Expected?

The build process should complete successfully without encountering any TypeScript errors.

What is Actually Happening?

During the build process, the TypeScript error TS2430 occurs in the file node_modules/rc-picker/lib/PickerPanel/index.d.ts.

node_modules/rc-picker/lib/PickerPanel/index.d.ts:40:18 - error TS2430: Interface 'SinglePickerPanelProps<DateType>' incorrectly extends interface 'BasePickerPanelProps<DateType>'.
  Types of property 'defaultValue' are incompatible.
    Type 'DateType | null | undefined' is not assignable to type 'DateType | undefined'.
      Type 'null' is not assignable to type 'DateType | undefined'.

40 export interface SinglePickerPanelProps<DateType extends object = any> extends BasePickerPanelProps<DateType> {
                    ~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/rc-picker/lib/PickerPanel/index.d.ts:40

Additional Comments:

Dependency Version
antd 5.14.1
dayjs 1.11.10
react ^18.2.0
react-dom ^18.2.0
RickieWoo commented 6 months ago

any solution?

chaiwei commented 6 months ago

You can ignore the error by adding "skipLibCheck": true to your compilerOptions in your tsconfig.json file.

"compilerOptions": {
    // ... the remaining options
    "skipLibCheck": true,
}

This will skip type checking of declaration files, which might resolve the TypeScript error you're encountering.

authc0d3 commented 4 months ago

Any progress with this?

ejsinfuego commented 4 months ago

I also come across this issue

@chaiwei already submit a pull request #765 . Thank you.