react-datepicker
react-datepicker copied to clipboard
Cannot find module 'date-fns/types' or its corresponding type declarations
I am getting this Typescript error:
node_modules/react-datepicker/dist/calendar.d.ts:10:26 - error TS2307: Cannot find module 'date-fns/types' or its corresponding type declarations.
import type { Day } from "date-fns/types";
date-fns includes types now, so I believe this can be changed to: import type { Day } from "date-fns";
Using: date-fns: 3.6.0 react-datepicker: 7.2.0
@mikejcoop I tried with codesandbox but could not reproduce. https://codesandbox.io/p/sandbox/react-datepicker-4946-mp4yl5?file=%2Fsrc%2FApp.tsx%3A4%2C1
Can you provide the code to reproduce it?
I've not been able to reproduce it in Code Sandbox, so it must been something else with my environment. Thanks for checking.