-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed as not planned
Labels
Description
Describe the bug
Using DatePicker with TS strict mode throws the following type error:
'DatePicker' cannot be used as a JSX component.
Its instance type 'ReactDatePicker<never, undefined>' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'import("/Users/ronny.efronny/projects/frontend/node_modules/@types/react-dom/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
Type '{}' is not assignable to type 'ReactNode'.ts(2786)To Reproduce
- Enable TS strict mode, or at least the rule
strictFunctionTypes. - Use
DatePicker.
Expected behavior
No errors.
- OS: Mac OS Monterey (12.6).
- TS version 4.9.0
react-datepickerversion 4.8.0@types/react-datepickerversion 4.4.2
This is currently preventing me from enabling strict mode on my project, and I would like to refraing from using ts-ignore. What can be done?
funatsufumiya, lucaprevitali and brianmontanaocient
