Tested on iPhone 14 Pro and iPhone 17 physical devices running iOS 26.2, both keep state intact and correctly increment with each display of the alert. Most teammates and myself see the loss of state behavior only on iPhone 17 (iOS 26.2) simulator and not other 17 variants or older sims.
The desire of LibraryView, inside a Swift package linked as a dependency, is to show a sheet when tapped without concern about how the app is using it within its view layout (ContentView in the example). Another example could be a package that has a public AccountView that when tapped shows a private account settings view. Allowing app to display the AccountView where they want without having to know internals for displaying the settings view.
Topic:
UI Frameworks
SubTopic:
SwiftUI