MCPcopy Create free account
hub / github.com/adobe/react-spectrum / ToastRegion

Function ToastRegion

packages/react-aria/stories/toast/Example.tsx:34–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32}
33
34function ToastRegion() {
35 let state = useContext(ToastContext)!;
36 let ref = useRef(null);
37 let {regionProps} = useToastRegion({}, state, ref);
38 return (
39 <div
40 {...regionProps}
41 ref={ref}
42 style={{
43 position: 'fixed',
44 bottom: 0,
45 right: 0,
46 display: 'flex',
47 flexDirection: 'column',
48 gap: 10
49 }}>
50 {state.visibleToasts.map(toast => (
51 <Toast key={toast.key} toast={toast} />
52 ))}
53 </div>
54 );
55}
56
57function Toast(props) {
58 let state = useContext(ToastContext)!;

Callers

nothing calls this directly

Calls 1

useToastRegionFunction · 0.90

Tested by

no test coverage detected