Skip to content
Discussion options

You must be logged in to vote

For quite intricate reasons, View (often) inherits a MainActor context that is inferred in .task modifiers, especially when directly used in .body. It seems it's not the case for ToolbarContent. You can probably work around by adding @MainActor at the beginning of your .task:

.task { @MainActor in await viewStore.send(.onAppear).finish() }

Replies: 1 comment 1 reply

Comment options

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

Answer selected by JaapWijnen
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