Skip to content

Commit 70143c1

Browse files
feat(toast): set empty object as default value for store props (#2693)
* feat(toast): set empty object as default value for store props * Update default value for store props in toast --------- Co-authored-by: Segun Adebayo <[email protected]>
1 parent 8f60309 commit 70143c1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/cuddly-geese-deliver.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@zag-js/toast": patch
3+
---
4+
5+
Set empty object as default value for store props

packages/machines/toast/src/toast.store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const withDefaults = <T extends object, D extends Partial<T>>(options: T, defaul
66
return { ...defaults, ...compact(options as any) }
77
}
88

9-
export function createToastStore<V = any>(props: ToastStoreProps): ToastStore<V> {
9+
export function createToastStore<V = any>(props: ToastStoreProps = {}): ToastStore<V> {
1010
const attrs = withDefaults(props, {
1111
placement: "bottom",
1212
overlap: false,

0 commit comments

Comments
 (0)