Skip to content
Discussion options

You must be logged in to vote

Allowing userId to be undefined makes me uneasy because it's possible for a developer error to occur where userId will never exist.

As an example in this code, if we navigate to page /todos/111111111 we always see the loading flag.

There are many ways around this issue. One would be to respect the status of the first query, e.g. if the userQuery goes into error state, you show an error state. Your useUserForTodo hook just doesn't do that.

This would achieve what your feature request would want. A timeout doesn't seem like a good fit because queries can take longer, can fail and then have retries etc. You usually can't know from a simple timeout that you have an error if the second que…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dwjohnston
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants