Closed StijnCoolen closed 11 months ago
Hello @StijnCoolen, Thank you for bringing this to our attention. A fix for this will be rolled out with the next release, for the time being you can set the screen name to "" to remove the latest value and get the same effect.
Hi @maryamshal that's great! Another thing I found while implementing this was that the Clarity docs suggest using the cleanup function of useCallback to reset the screen. React Navigation however advices against this and instead use the 'blur' event: https://reactnavigation.org/docs/7.x/use-focus-effect/#when-to-use-focus-and-blur-events-instead
Does this make any difference for Clarity?
Hello @StijnCoolen,
No, this won't make any difference for Clarity, you can reset it in the cleanup function or in the blur
event.
it's worth noting that you can use the way mentioned here https://github.com/microsoft/clarity-apps/issues/23#issuecomment-1837501594 to set the current screen name and not bother to reset it.
The
setCurrentScreenName
docs state "You can it set tonull
to remove the latest set value." The type however expects aString
.