function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tejender Mohan 9Tejender Mohan 9 

How to reload custom lightning component in a lightning page tab every time I click on the tab?

Hi
I have one lightning component named "Add/Edit Invoice Line Item" (as seen on screenshot) I want to reload this component every time a user clicks on this tab. Is there any way or event which can be used to handle this? 
User-added image
Best Answer chosen by Tejender Mohan 9
Tejender Mohan 9Tejender Mohan 9
Hey Ravi
Click on the lightning page tab does not make any change on URL hence the aura:locationChange will not work.

I have searched for the solution for 2 days (asked multiple people and checked documentation) but couldn't find anything.
So I have added an idea for salesforce to provide developers with Accessible Lightning Events from Lightning Page.
If you think this Idea can be useful to you as a developer the please upvote.

Idea : Accessible Lightning Events from Lightning Page. (https://success.salesforce.com/ideaView?id=0873A000000CZbzQAG)

Thanks

All Answers

Ravi Dutt SharmaRavi Dutt Sharma
Not sure, but aura:locationChange might be a thing to look for. Let us know if it works.

https://developer.salesforce.com/docs/component-library/bundle/aura:locationChange/documentation
Tejender Mohan 9Tejender Mohan 9
Hey Ravi
Click on the lightning page tab does not make any change on URL hence the aura:locationChange will not work.

I have searched for the solution for 2 days (asked multiple people and checked documentation) but couldn't find anything.
So I have added an idea for salesforce to provide developers with Accessible Lightning Events from Lightning Page.
If you think this Idea can be useful to you as a developer the please upvote.

Idea : Accessible Lightning Events from Lightning Page. (https://success.salesforce.com/ideaView?id=0873A000000CZbzQAG)

Thanks
This was selected as the best answer