-
-
Notifications
You must be signed in to change notification settings - Fork 458
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
fetching
initially false
?
#245
Comments
I'm having the same issue right now 😬 |
Yeah doesn't really make sense. It's cumbersome to have to work around |
I still don't understand the reasoning behind this, because now, we can't just simply rely on Also, that always generates an extra rendering cycle for every component. First, |
@larsbs as posted above though, this will be fixed in the next version. |
@kitten Oh sorry, I understood actually the opposite, that it was expected behavior and it would ship in the final version. Thanks. |
@larsbs sorry, I'll post a more extensive explanation 😅 Basically this was fixed by the two linked PRs which happened to set up some preliminary behaviour for the SSR PR as well. During initial mount they cause effects and state changes to run synchronously due to two special hooks. Since our exchange pipeline is built to be mostly synchronous this means that the initial state will match the ongoing / completed operation more closely. When it starts fetching the state change setting it to true will immediately be applied on mount without an additional render. But additionally this also means that you will immediately get the data you queried if it has already been cached before |
That's perfect, so I guess that would also fix the other issue I had #267 good job 👍 |
All the documentation and code examples suggest if you check that
fetching
istrue
anderror
is falsey then you can assumedata
is not null.e.x.
https://github.com/FormidableLabs/urql#quick-start-guide
However, that's not what I'm seeing.
fetching
is initiallyfalse
:This happens for both the
Query
component anduseQuery
hook. Unless you explicitly check thatdata
is not null then these examples will crash.Or am I missing something?
Version: 1.0.5
The text was updated successfully, but these errors were encountered: