Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: fix flashing error dialog in the create workspace page#18180

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jaaydenh merged 2 commits intomainfromjaaydenh/react-query-fix
Jun 2, 2025

Conversation

jaaydenh
Copy link
Contributor

This PR which updated react-query to 5.77.0 introduced an issue on the create workspace page where the error dialog would be briefly displayed while the page is loading.#18039

The issue is that there is a moment whenoptOutQuery.isLoading is false andoptOutQuery.data is undefined causing the ErrorAlert to display.

BrunoQuaresma reacted with heart emoji
@jaaydenhjaaydenh self-assigned thisJun 2, 2025
@jaaydenhjaaydenh changed the titlefix: flashing error dialog in create workspace pagefix: fix flashing error dialog in the create workspace pageJun 2, 2025
@BrunoQuaresma
Copy link
Collaborator

Thanks for fixing it 🙏

@aslilac
Copy link
Member

what if we did something like

if(query.isError){return<ErrorAlerterror={query.error}/>;}if(!query.data){return<Loader/>;}

so that we don't need to use the? operator to read fromdata after the check?

@jaaydenh
Copy link
ContributorAuthor

what if we did something like

if(query.isError){return<ErrorAlerterror={query.error}/>;}if(!query.data){return<Loader/>;}

so that we don't need to use the? operator to read fromdata after the check?

I suppose that works but looking at the react query docs, it feels like using isLoading/isPending is the straight-forward clearest way to do things,https://tanstack.com/query/latest/docs/framework/react/guides/queries

@aslilac
Copy link
Member

aslilac commentedJun 2, 2025
edited
Loading

but they don't give us the type safety that checkingdata directly does. I really prefer narrowing the type rather than using?. everywhere and assuming it'll be fine.

@jaaydenhjaaydenh merged commitfd6981e intomainJun 2, 2025
33 checks passed
@jaaydenhjaaydenh deleted the jaaydenh/react-query-fix branchJune 2, 2025 20:55
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 2, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@aslilacaslilacAwaiting requested review from aslilac

Assignees

@jaaydenhjaaydenh

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@jaaydenh@BrunoQuaresma@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp