You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the multiple issues opened at once, but this one has been a head-scratcher for me. So if you've got views that nest views using environment objects the ViewHosting.host(view.environmentObject(object)) trick doesn't work. Any nested view that also requires environment objects doesn't get it.
I have a feeling (after trying to dive into this) that you're just limited by what Apple allows for, it may just be a documentation update. However as a relatively new user of the library (and somebody new to SwiftUI) I was baffled for a bit why environment objects weren't affecting...well...the whole environment.
The text was updated successfully, but these errors were encountered:
Hey, yes, this is a known #62 issue, sorry about that. You're right, environment object isn't automatically injected into the whole hierarchy, SwiftUI seems to be doing it individually for every view. I do have a couple of ideas for how to work around this limitation, in the meanwhile, I recommend testing such custom views separately.
Sorry for the multiple issues opened at once, but this one has been a head-scratcher for me. So if you've got views that nest views using environment objects the
ViewHosting.host(view.environmentObject(object))
trick doesn't work. Any nested view that also requires environment objects doesn't get it.I have a feeling (after trying to dive into this) that you're just limited by what Apple allows for, it may just be a documentation update. However as a relatively new user of the library (and somebody new to SwiftUI) I was baffled for a bit why environment objects weren't affecting...well...the whole environment.
The text was updated successfully, but these errors were encountered: