Closed regexident closed 2 years ago
Good catch. I think you may still need to add in the values .defaultEnvironment
sets up if they are not already setup by the rootEnvironment
though, specifically _ToggleStyleKey
, .colorScheme
, ._defaultAppStorage
, and _DefaultSceneStorageProvider
.
Let me know if you'd rather have the merging logic as a private implementation detail. I figured since effectively every backend/renderer implementation would need it it might be worth providing a canonical method for it. Providing both .merge(_:)
and .merging(_:)
might a bit overkill though.
Since this isn't part of SwiftUI, may be best to make it internal with @_spi
so the renderers can access it but users don't.
Absolutely! Fixed.
Fixed!
While spelunking through the implementation of
EnvironmentValues
and its uses in Tokamak I noticed that a couple of functions were accepting arootEnvironment: EnvironmentValues? = nil
argument but then discarding whatever value you pass to it in favor of.defaultEnvironment
.This seems wrong to me? 🤔