Kiarash-Z / react-modern-calendar-datepicker

A modern, beautiful, customizable date picker for React
https://kiarash-z.github.io/react-modern-calendar-datepicker/
MIT License
1k stars 209 forks source link

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

Open cheelix opened 8 months ago

cheelix commented 8 months ago

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

RezaGhx commented 8 months ago

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

ShivBhanKushWaha commented 2 months ago

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

RezaGhx commented 2 months ago

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

ShivBhanKushWaha commented 2 months ago

Ys I will use another package