react-modern-calendar-datepicker icon indicating copy to clipboard operation
react-modern-calendar-datepicker copied to clipboard

Nexjs some issue: typeError: Cannot read properties of null (reading 'removeEventListener')

Open cheelix opened this issue 1 year ago • 4 comments

"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')

cheelix avatar Nov 18 '23 09:11 cheelix

https://github.com/Kiarash-Z/react-modern-calendar-datepicker/issues/204#issuecomment-757520714

RezaGhx avatar Nov 19 '23 06:11 RezaGhx

same issue i am facing and the main reason is that after returning the eventListner is not set

ShivBhanKushWaha avatar Apr 26 '24 16:04 ShivBhanKushWaha

check the comment above. you should use an alternative package similar to this one.

RezaGhx avatar Apr 26 '24 17:04 RezaGhx

Ys I will use another package

ShivBhanKushWaha avatar Apr 27 '24 04:04 ShivBhanKushWaha