I have a toast notification created using react-bootstrap. I need to dismiss it if the user clicks anywhere outside the toast. Someone knows how can I do that?
This is the toast I'm using:
//what am I importing
import { Toast } from 'react-bootstrap';
//how am I using it
<Toast
onClose={() => props.OnClose(false)}
data-testid="toast"
show={props.Show}
delay={10000}
autohide
>
<Toast.Header closeButton={false}>
<div>
{props.Icon}
</div>
<div>
Title
</div>
<div
onClick={() => props.OnClose(false)}
>
<ToastClose />
</div>
</Toast.Header>
<Toast.Body>
Body text
</Toast.Body>
</Toast>