Skip to content

Conversation

@Austin2Shih
Copy link
Collaborator

Problem:
We have hooks that have inputs that depend on the results of other hooks, like our auth state for example. Our auth state (user) might have an undefined user_id if we are querying it early. Now, this undefined value might get passed in as an initializer value for one of our own user defined hooks such as getSubmissions. Then, it'll run through the fetchSubmissions function with the bad input, then setLoading(false). When loading is false, the frontend will assume that the data is ready to read (that's the paradigm we've been using) so the frontend will try to do data manipulation on smth that isn't ready. However, soon the auth state will finish loading and real data will get passed in, hence the quick flash of error that fixes itself.

@JayJ104 JayJ104 merged commit c6f43fe into main Apr 20, 2025
2 of 3 checks passed
@JayJ104 JayJ104 deleted the fix/projects-page-flash-error branch April 20, 2025 07:01
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

Successfully merging this pull request may close these issues.

3 participants