react-flatpickr icon indicating copy to clipboard operation
react-flatpickr copied to clipboard

Warning: unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering

Open vfonic opened this issue 4 years ago • 3 comments

Hi! Thanks for the great library!

I'm having some issues where react throws errors when Flatpickr props update. This happens no matter how fast (slow) I click on flatpickr days.

I'm using flatpickr as a calendar widget where user can click on a date and check events for that day.

The error happens somewhere in DateTimePicker component.

Any ideas?

This is how I'm rendering flatpickr:

<Flatpickr
  onChange={datesSelected => onChangeDate(datesSelected[0])}
  value={value}
  options={{
    ...(dates ? { enable: dates } : { disable: [] }),
  }}
/>

The bit that's throwing the warning is when dates array changes.

vfonic avatar Dec 03 '19 18:12 vfonic

I was seeing this on version 3.6.4, but by upgrading to 3.10.0 it resolved itself.

jweatherby avatar Mar 02 '20 18:03 jweatherby

I am running version 3.10.0 and also experiencing this issue.

chris-tse avatar Jul 14 '20 14:07 chris-tse

I get this warning too

haotian0812 avatar Nov 17 '23 05:11 haotian0812