({state, ...props}: AriaToastRegionProps & {state: ToastState<string>})
| 30 | } |
| 31 | |
| 32 | function ToastRegion({state, ...props}: AriaToastRegionProps & {state: ToastState<string>}) { |
| 33 | let ref = useRef<HTMLDivElement>(null); |
| 34 | /*- begin highlight -*/ |
| 35 | let {regionProps} = useToastRegion(props, state, ref); |
| 36 | /*- end highlight -*/ |
| 37 | let {focusProps, isFocusVisible} = useFocusRing(); |
| 38 | |
| 39 | return ( |
| 40 | <div |
| 41 | {...mergeProps(regionProps, focusProps)} |
| 42 | ref={ref} |
| 43 | className="react-aria-ToastRegion" |
| 44 | data-focus-visible={isFocusVisible || undefined}> |
| 45 | {state.visibleToasts.map(toast => ( |
| 46 | <Toast key={toast.key} toast={toast} state={state} /> |
| 47 | ))} |
| 48 | </div> |
| 49 | ); |
| 50 | } |
| 51 | |
| 52 | function Toast({state, toast, ...props}: AriaToastProps<string> & {state: ToastState<string>}) { |
| 53 | let ref = useRef<HTMLDivElement>(null); |
nothing calls this directly
no test coverage detected