ViewInspector icon indicating copy to clipboard operation
ViewInspector copied to clipboard

ViewHosting cache

Open Tyler-Keith-Thompson opened this issue 3 years ago • 1 comments

I've run into a problem I don't fully understand. I'm getting a cached result when using a UIViewRepresentable and calling .actualView().uiView() that's causing tests to fail for the wrong reason.

I traced the problem back to find it's because of the store method on ViewHosting. It can't uniquely identify views, it simply stores with host(_:).

I was able to work around my problem by calling ViewHosting.expel(function: "host(_:)") before each test...but that seems like it shouldn't be necessary.

Tyler-Keith-Thompson avatar Jun 29 '22 23:06 Tyler-Keith-Thompson

Update: This may have to do with a convenience I wrote, but I'm still not quite understanding how it's supposed to work.

Tyler-Keith-Thompson avatar Jun 29 '22 23:06 Tyler-Keith-Thompson

From what I understand you're facing the problem reported in #166, I'll close this one as duplicate, feel free to subscribe on that issue, as I'm planning on fixing it.

nalexn avatar Sep 10 '22 21:09 nalexn