Skip to content

Commit

Permalink
Fix issue in Toast component key handling
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhabib committed Jul 12, 2024
1 parent 840e886 commit a3b0d6c
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 36 deletions.
10 changes: 10 additions & 0 deletions .changeset/strange-otters-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'braid-design-system': patch
---

---
updated:
- Toast
---

Fix warning in React 18.3.0 when using useToast.
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ export const useToast = () => {
return useCallback(
(toast: Toast) => {
const id = `${toastCounter++}`;
const dedupeKey = toast.key ?? id;
const { key, ...rest } = toast;
const dedupeKey = key ?? id;

addToast({
...toast,
...rest,
vanillaTheme,
id,
dedupeKey,
Expand Down
Loading

0 comments on commit a3b0d6c

Please sign in to comment.