Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
javeedrahman opened this issue Feb 18, 2019 · 6 comments
Open

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

javeedrahman opened this issue Feb 18, 2019 · 6 comments

Comments

@javeedrahman
Copy link

javeedrahman commented Feb 18, 2019

I am getting the following error.

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

@javeedrahman javeedrahman changed the title destroy How to destroy datepicker instance from one route to another? Feb 18, 2019
@javeedrahman
Copy link
Author

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

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

@jacobmischka
Copy link
Collaborator

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

@javeedrahman
Copy link
Author

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
Copy link

aleiruiz commented Jan 9, 2024

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

@shaj-ed
Copy link

shaj-ed commented Jul 27, 2024

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

@srihari-m-s
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants