Skip to content

Rendering child views without using ForEachStore #985

Discussion options

You must be logged in to vote

Hey @josephktcheung!

I think your solution is totally reasonable! We're not aware of [AnyView] being a widespread pattern in library design, but without a @ViewBuilder interface your workaround would seem to be necessary here.

You are now aware of some of the messiness that lives inside ForEachStore (like the internal caching of state, and force unwraps, which isn't great). Those workarounds are specifically there to account for behavior/bugs in SwiftUI's ForEach view, though, so you may find they're not necessary.

Thanks for sharing your solution!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@josephktcheung
Comment options

Answer selected by josephktcheung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants