Replies: 1 comment 2 replies
-
Hi @kashinios, you are observing state here: WithViewStore(self.store, observe: { $0 }) { viewStore in And that line says to observe all state changes. So even though all you need is Luckily the view store stuff has been deprecated for nearly a full year, ever since we released 1.7. Is there a reason you are using the view store? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to resolve an issue with view re-rendering.
I expect that ALL my views inside TabView will be re-rendered for each state change. For example, if HomeFeature makes some changes in its state, ProfileView and HistoryView are re-rendering too. It's happened because my State in RootFeature contains all states for creating a TabView, but all views re-rendering affects the performance in my app and I don't need this extra load.
Is there any different way to deal with TabView to avoid re-rendering screens unrelated to state updating? Maybe it's another implementation, etc.
Code looks like this:
`
@Reducer
struct RootFeature {
struct State: Equatable {
var homeTab = HomeFeature.State()
var historyTab = HistoryFeature.State()
var profileTab = ProfileFeature.State()
}
struct RootView: View {
@Perception.Bindable var store: StoreOf
}
`
Beta Was this translation helpful? Give feedback.
All reactions