haoxins / react-flatpickr

flatpickr for React
MIT License
598 stars 102 forks source link

How to destroy datepicker instance from one route to another? #83

Open javeedrahman opened 5 years ago

javeedrahman commented 5 years ago

I am getting the following error.

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

javeedrahman commented 5 years ago

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

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

jacobmischka commented 5 years ago

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

javeedrahman commented 5 years ago

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(); }

aleiruiz commented 8 months ago

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

shaj-ed commented 1 month ago

hello, is there any solution yet i am facing this destroy issue on lazy loaded components.

srihari-m-s commented 1 month ago

Hello. I am also facing this issue after implementing lazy loading. Is a fix for this planned?