How to make Notification go away?

In my application I am using Notifications with a timeout >0 for info and warning messages and with timeout==0 for errors.
According to the description I expected that notifications go away when clicking into them but that’s obviously not the case which causes error-notifications to pile up in the lower left corner until they cover a substantial part of the screen. At that point I typically need to refresh (i.e. reload) the page manually to be able to see my UI again. I consider this pretty annoying!

Why don’t these notifications not go away when clicking into them? Do I have to explicitly add a button (or some other UI element) with a click-listener to close them? This seems to contradict the description.

Which description are you referring to?

The docs page for the Notification component says
“Persistent notifications should contain a Button that closes the notification, or allows the user to take appropriate action. Less-important notifications shouldn’t be persistent, and instead disappear automatically after an appropriate delay.”

So yes, you should add a Button to dismiss the notification.