Skip to content

Modal view content disappears upon dismissal #3708

Answered by mbrandonw
maxkazakov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @maxkazakov, this API for fullscreenCover is old and deprecated:

.fullScreenCover(
  store: self.store.scope(state: \.$destination.modal, action: \.destination.modal),
  content: { ModalView(store: $0) }
)

The modern style is this:

.fullScreenCover(
  item: $store.scope(state: \.destination?.modal, action: \.destination.modal)
) { 
  
}

This is the style recommended throughout the documentation and in the migration guide for 1.7, where this tool was introduced.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maxkazakov
Comment options

Answer selected by maxkazakov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants