hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 659 forks source link

DefinedRange type issue #493

Closed nriin-oji closed 2 years ago

nriin-oji commented 3 years ago

Subject of the issue

'DefinedRange' only refers to a type, but is being used as a value here. Although this issue exists, it does not break the code. yet it trigger the linter. My temporary solution is duplicate existing types then re-create on new global.d.ts file

My implementation

Screenshot_48

Defined range exported type instead of class

Screenshot_49

[BUG] Bug Reproduce Steps

I just following the instruction based on this page

[BUG] Expected behaviour

Import the DefinedRange without issue

Environment

Package Version: 1.2.0 React version: 16.12.0 Typescript version: 4.2.4 Node version: 12.0.0 Browser: Chrome 91.0.4472.101

kamyar commented 3 years ago

Where do you use the types from? https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-date-range/index.d.ts#L289 ? Because that one is outdated as far as I know

nriin-oji commented 3 years ago

@kamyar I was using that one

naufaldi commented 2 years ago

any update regarding this @kamyar @nriin-oji ? i have same problem.

nriin-oji commented 2 years ago

any update regarding this @kamyar @nriin-oji ? i have same problem.

I copied original type then create new type in global.d.ts and adjust the DefinedRange type to export class DefinedRange extends React.Component<DefinedRangeProps> {}