react-modern-calendar-datepicker
react-modern-calendar-datepicker copied to clipboard
Nexjs some issue: typeError: Cannot read properties of null (reading 'removeEventListener')
"use client" import React, { useState } from "react"; import "react-modern-calendar-datepicker/lib/DatePicker.css"; import DatePicker from "react-modern-calendar-datepicker";
const App = () => { const [selectedDay, setSelectedDay] = useState(null); return ( <DatePicker value={selectedDay} onChange={setSelectedDay} inputPlaceholder="Select a day" shouldHighlightWeekends /> ); };
export default App;
The code totally same copy but ,when I selected a date, error happened: Unhandled Runtime Error TypeError: Cannot read properties of null (reading 'removeEventListener')
https://github.com/Kiarash-Z/react-modern-calendar-datepicker/issues/204#issuecomment-757520714
same issue i am facing and the main reason is that after returning the eventListner is not set
check the comment above. you should use an alternative package similar to this one.
Ys I will use another package