Why I am getting this I have install date-fns and I have trying to remove and update npm and node also remove package-lock json file but not resolved
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
Thanks
I want to Date picker
2
Answers
I just ran into the same problem. I resolved the issue by using an older version of react-datepicker.
When you run npm install react-datepicker it will install the latest version which is
6.1.0
and was published 5 days ago.I picked a version from one year ago: 4.10.0
https://www.npmjs.com/package/react-datepicker?activeTab=versions
Un-Install your current version and re-install naming a different version
then can apply the code
https://www.npmjs.com/package/react-datepicker?activeTab=readme
you can use the below versions of react-datepicker and date-fns to avoid issues.
"date-fns": "^3.3.1", "react-datepicker": "^4.25.0"