// The route of the screen a view is drawn in, as the navigator's path holds // it (`RouteScreen`): what a screen tells the navigator about itself — that // it carries its own composer, that it closes to where it was opened from. import CottonKit import SwiftUI private struct ScreenRouteKey: EnvironmentKey { static let defaultValue: Route? = nil } extension EnvironmentValues { /// The route of the screen on the navigator's path this view is drawn /// in (`RouteScreen`); nil on a screen pushed on a view's own stack. var screenRoute: Route? { get { self[ScreenRouteKey.self] } set { self[ScreenRouteKey.self] = newValue } } }