MCPcopy
hub / github.com/adobe/react-spectrum / useToastState

Function useToastState

packages/react-stately/src/toast/useToastState.ts:60–67  ·  view source on GitHub ↗
(props: ToastStateProps = {})

Source from the content-addressed store, hash-verified

58 * of actions, errors, or other events in an application.
59 */
60export function useToastState<T>(props: ToastStateProps = {}): ToastState<T> {
61 let {maxVisibleToasts = 1, wrapUpdate} = props;
62 let queue = useMemo(
63 () => new ToastQueue<T>({maxVisibleToasts, wrapUpdate}),
64 [maxVisibleToasts, wrapUpdate]
65 );
66 return useToastQueue(queue);
67}
68
69/**
70 * Subscribes to a provided toast queue and provides methods to update it.

Callers 5

ToastContainerFunction · 0.90
FakeToastFunction · 0.90
FakeToastFunction · 0.90
Toast.stories.tsxFile · 0.90

Calls 1

useToastQueueFunction · 0.85

Tested by

no test coverage detected