You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents unsubscribe logic to work, if it is triggered from another part of the application. However, I don't know if this is intentional. Our use case
We have a nextjs application where useExitIntent is initialized in the root layout
We have a button near the footer where the user can willingly click to trigger the exit intend model dialog and subscribe
When the user manually trigger the modal, we tigger unsubscribe()
Due to the cookie only been read during initial mount and not inside the handler callback, the modal triggers again in certain scenarios
In this use case the check for shouldNotTrigger.current is not enough, as the exit-intent cookie won't be read again.
Any suggestions for solving this problem differently are welcome.
The text was updated successfully, but these errors were encountered:
Hello,
currently, the cookie seems to be read once when the component is mounted: https://github.com/daltonmenezes/use-exit-intent/blob/main/packages/use-exit-intent/src/index.ts#L150.
This prevents unsubscribe logic to work, if it is triggered from another part of the application. However, I don't know if this is intentional. Our use case
useExitIntent
is initialized in the root layoutunsubscribe()
In this use case the check for
shouldNotTrigger.current
is not enough, as the exit-intent cookie won't be read again.Any suggestions for solving this problem differently are welcome.
The text was updated successfully, but these errors were encountered: