#932·dillinger

Fix React duplicate key warning in Toast notifications

Author: bijanmurmuCreated May 30, 2026Updated May 30, 2026

Description

The Toast notification component currently uses Date.now().toString() to generate unique IDs for each toast.

If notify() is called twice in rapid succession (within the same millisecond), both toasts receive the exact same ID. This causes a React “Encountered two children with the same key” console warning, and can lead to the second toast failing to render correctly due to React's reconciliation process.

How to fix

This can be quickly resolved by replacing Date.now().toString() with crypto.randomUUID() in components/ui/Toast.tsx to guarantee absolute uniqueness for every toast.

I would love to submit a quick PR for this if a maintainer can assign this to me!