Input
User clicks add-btn 3 times
Output
3 elements with data-testid="notification" are present in the tray
Build a notification tray in React where a button and a tray are sibling components sharing state. Render `data-testid="add-btn"` — clicking it adds a notification. Render `data-testid="notification-tray"` containing ac...
App.tsxEditable starterUser clicks add-btn 3 times
3 elements with data-testid="notification" are present in the tray
How would you add a maximum cap (e.g. only 5 notifications at once) and auto-dismiss after 3 seconds without breaking the existing dismiss-button behavior?