Compiler giving "The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions" issue when using multiple sheets with Destination Reducer approach #2922
-
Hi team I'm using Destination(4) reducer feature to combine all my presentation sheets, So in my view I have some normal sheets and some grouped Destination reducer sheet. @Reducer var body: some Reducer<State, Action> { @bindable var store: Store<SampleFeature.State, SampleFeatureAction> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @parvBhaskarStryker, there is no limitation set by TCA, but there may be limitations of the Swift compiler. Typically you can move the extension View {
func destinations(store: Binding<StoreOf<Feature>>) -> some View {
self
.sheet(item: store.scope(…)) { … }
.sheet(item: store.scope(…)) { … }
.sheet(item: store.scope(…)) { … }
.sheet(item: store.scope(…)) { … }
}
} And the do: var body: some View {
Form {
}
.destinations(store: $store)
} That's the rough idea. In the future these kinds of compilation problems will hopefully get better when we can delete the many overloads we have in the library. But we need to wait for 2.0 for that. |
Beta Was this translation helpful? Give feedback.
Hi @parvBhaskarStryker, there is no limitation set by TCA, but there may be limitations of the Swift compiler. Typically you can move the
sheet
's to their own helper in the view to help out the compiler:And the do:
That's the rough idea.
In the future these kinds of compilation problems will hopefully get better when we can delete the many overloads we have in …