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

How to destroy datepicker instance from one route to another?

Open javeedrahman opened this issue 6 years ago • 6 comments

I am getting the following error.

Uncaught TypeError: this.flatpickr.destroy is not a function at DateTimePicker.componentWillUnmount

javeedrahman avatar Feb 18 '19 14:02 javeedrahman

For information:: key: 'componentWillUnmount', value: function componentWillUnmount() { this.flatpickr.destroy(); }

Uncaught TypeError: this.flatpickr.destroy is not a function at t.value

javeedrahman avatar Feb 18 '19 16:02 javeedrahman

Sorry, are you trying to manually destroy it, or is that destroy() call being made by this library?

jacobmischka avatar Feb 18 '19 17:02 jacobmischka

I have been using mern application and I am using routing. When I route one (which have flatpickr) to another (this route dont have flastpickr) this error shows in the console.

key: 'componentWillUnmount', value: function componentWillUnmount() { this.flatpickr.destroy(); }

javeedrahman avatar Feb 19 '19 05:02 javeedrahman

Hi, is there any updates on this? it is still happening on lazy loaded components.

aleiruiz avatar Jan 09 '24 06:01 aleiruiz