Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StateObject vs. ObservedObject usage #19

Open
rnmp opened this issue Nov 12, 2022 · 0 comments
Open

StateObject vs. ObservedObject usage #19

rnmp opened this issue Nov 12, 2022 · 0 comments

Comments

@rnmp
Copy link

rnmp commented Nov 12, 2022

Hey @fmo91,

Amazing library. Good to see the learnings from the React ecosystem making it to the ever so expressive Swift.

Reaching out because I spent quite a bit of time getting the library to work. I set up a Query following your examples quite closely, but I couldn't get my views to update. It all finally worked out when instead of using @ObservedObject, I switched to @StateObject.

I am completely new to Swift/SwiftUI so my code is very vanilla, was wondering if this is something you encountered before or would know why there would be a difference between the two in this use case.

Couple of sites that led me to this discovery:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant