If I dynamically impersonate different users for a POC I am showcasing soon, the subscriberId changes but the list of notifications is still from the previous subscriberId. Storing the last used subscriberId in localStorage makes it easy to just reload the page and I see what I expect but I wonder how I can refresh the list of notifications when subscriberId changes.
#How to refresh React notifications when `subscriberId` changes?
1 messages · Page 1 of 1 (latest)
@abstract herald, you just advanced to level 1!
@abstract herald use refetch function of useNotifications hook
https://docs.novu.co/notification-center/react/api-reference/#usenotifications
Thanks for the answer, I tried but it seems it needs to be used inside the context of the NovuProvider and Im not sure how that goes, is there a piece of sample on how this hook is used?
Yes in a Nextjs project