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
If you're using the find functionality so search for something in the view hierarchy after something with an environment object thar be crashes. I tried for about 3 hours to dig into this and understand the different between calling view(Type.self) (which works) vs find(Type.self) but it's honestly gonna take longer to understand all of the inner workings of the library. Here is a test that reproduces my issue:
// In your view search tests, where you define views:
finalclassModelData:ObservableObject{varstringProperty="Model"}structEnvironmentView:View,Inspectable{@EnvironmentObjectvardata:ModelDatavarbody:someView{Text(data.stringProperty)}}
// Thing that crashes but shouldn't
func testFindPastViewWithEnviornmentObject()throws{structEmbedded:View,Inspectable{varbody:someView{Test.EnvironmentView()Text("")}}letview=tryEmbedded().inspect()XCTAssertNoThrow(try view.find(ViewType.Text.self))}
The text was updated successfully, but these errors were encountered:
If you're using the find functionality so search for something in the view hierarchy after something with an environment object thar be crashes. I tried for about 3 hours to dig into this and understand the different between calling
view(Type.self)
(which works) vsfind(Type.self)
but it's honestly gonna take longer to understand all of the inner workings of the library. Here is a test that reproduces my issue:The text was updated successfully, but these errors were encountered: