Hacker0x01 / react-datepicker

A simple and reusable datepicker component for React
https://reactdatepicker.com/
MIT License
7.89k stars 2.23k forks source link

Cannot find module 'date-fns/types' or its corresponding type declarations #4946

Open mikejcoop opened 2 days ago

mikejcoop commented 2 days ago

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

yuki0410-dev commented 1 day ago

@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?