Neither forceCommunity:routeChange or aura:locationChange cannot detect the URL change with history.replaceState

We have a use case where a lightning component built in LWC, should trigger a URL change.

We’re handling that with the history.replaceState method(note that we encountered the same problem with history.pushState).

In the other hand, upon a URL change an Aura Component should rerender/reflect this change.

Problem:

Neither of the standard events forceCommunity:routeChange or aura:locationChange are able to pickup the URL change.

Is this a bug or these events are not supposed to pickup such kind of URL change?

Reproducing the problem:

In order to reproduce this scenario I’ve built a basic demo app, that can be found & deployed from this repo.

Answer

Attribution
Source : Link , Question Author : Endrit Sino , Answer Author : Community

Leave a Comment