react-modern-calendar-datepicker
react-modern-calendar-datepicker copied to clipboard
T.current is null
Describe the bug hi, I'm using this in nextjs but why I get T.current is null and I use it like a document nothing extra added to it.
My code import 'react-modern-calendar-datepicker/lib/DatePicker.css'; import DatePicker from 'react-modern-calendar-datepicker'; const [selectedDay, setSelectedDay] = useState(null);
<DatePicker
value={selectedDay}
onChange={setSelectedDay}
shouldHighlightWeekends
locale="fa" // add this
/>
I'm using react 17.0.1
same issue here on react ver. 17.0.1
Same issue here, with this code using react-hook-form:
<Controller
name={labelLocaleId}
control={control}
rules={{ required: required }}
render={({ onChange, value, name, ref }) => (
<DatePicker
inputRef={ref}
inputName={name}
onChange={onChange}
value={value}
/>
)}
/>
ver: "react": "^17.0.1"
Samoe for me in a webapp and firefox crashes
same here help!
same issue with Next.js 10.0.7
I'm using react 17.0.1 & have the same issue in FireFox, But Not in Chrome (Both are the latest version!
Same here on react@^17.0.2. Weird thing is that it happens on Firefox but not on Chrome.
Same issue on next 11.0.1
Still no news from devs? Has anyone solved this?
I don't know this helps others or not but I had this problem and did these:
-
unminify
index.js
in lib -
change the this line:
T.current.removeEventListener("keyup", e, !1);
to this:
if(T.current) T.current.removeEventListener("keyup", e, !1);
NOTE: After that you should restart react server to load your changes: npm start
or yarn start
Here's the solution: https://github.com/Kiarash-Z/react-modern-calendar-datepicker/issues/284#issuecomment-950307226