Skip to main content
Tweeted twitter.com/StackSalesforce/status/1218775227531976704
added 358 characters in body
Source Link

I would like to know if there is a way to destroy LWC component from its js controller. I know in Aura there is something called component.destroy() method. But in lwc I couldn't something like that. Please shed some light on this.

The problem I am facing is, I have created a 'New' page for opportunity with LWC and upon submitting, navigating to the view page. But after that when I come back to opportunity 'New' page, at times, the page doesn't load or the form with previous values is being shown. Hence I would like to destroy the current component after navigating to view page.

I would like to know if there is a way to destroy LWC component from its js controller. I know in Aura there is something called component.destroy() method. But in lwc I couldn't something like that. Please shed some light on this.

I would like to know if there is a way to destroy LWC component from its js controller. I know in Aura there is something called component.destroy() method. But in lwc I couldn't something like that. Please shed some light on this.

The problem I am facing is, I have created a 'New' page for opportunity with LWC and upon submitting, navigating to the view page. But after that when I come back to opportunity 'New' page, at times, the page doesn't load or the form with previous values is being shown. Hence I would like to destroy the current component after navigating to view page.

Source Link

Is there a way to destroy LWC from its js controller?

I would like to know if there is a way to destroy LWC component from its js controller. I know in Aura there is something called component.destroy() method. But in lwc I couldn't something like that. Please shed some light on this.