// // RootView.swift // Root // import SwiftUI import Facts import ComposableArchitecture /// The root view of the entire app. public struct RootView: View { @Bindable var store: StoreOf public init(store: StoreOf) { self.store = store } public var body: some View { NavigationStack { // Super basic here; I want to show a FactsView scoped to just that feature's `State` and `Action`s. FactsView(store: store.scope(state: \.facts, action: \.facts)) }.onAppear { store.send(.viewAppeared) } } } #Preview { RootView(store: .init(initialState: RootFeature.State()) { RootFeature() }) }