Skip to content

Fix: Updates usePendingChangesNotification hook to fix component re-mount#134

Open
CGoodwin90 wants to merge 1 commit intomainfrom
prod-toast-fix
Open

Fix: Updates usePendingChangesNotification hook to fix component re-mount#134
CGoodwin90 wants to merge 1 commit intomainfrom
prod-toast-fix

Conversation

@CGoodwin90
Copy link
Collaborator

@CGoodwin90 CGoodwin90 commented Feb 11, 2026

Currently the usePendingChangesNotification toast is cleaned up and remounted whenever dependencies change (prod only), causing the toast to appear to flicker and occasionally not render.

This fixes the original logic by splitting the updates and the cleanup across two useEffect hooks, removing the cleanup flicker from the main hook and having that only run on mount/unmount/navigation in the second hook. This also keeps the NODE_ENV check to handle the double mount Strict Mode enforces when running in dev.

Can verify the fix here: https://ui.prod-toast-fix.lagoon-beta-ui.test6.amazee.io/projects/drupal-example/drupal-example-master

@CGoodwin90 CGoodwin90 marked this pull request as ready for review February 11, 2026 22:49
@CGoodwin90 CGoodwin90 requested a review from mattswann February 11, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant