Skip to content

fix: rearrange render logic #16631

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

Merged
merged 2 commits into from
Feb 19, 2025
Merged

fix: rearrange render logic #16631

merged 2 commits into from
Feb 19, 2025

Conversation

brettkolodny
Copy link
Contributor

Change the render logic so that we always show an error message if the error is available

Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I often like to do

if (isLoading) {
  return <Loader />
}

if (!data) {
  return <ErrorAlert error={error} />
}

because ErrorAlert can appropriately handle getting undefined, and if it's not loading but we also don't have data, then something did go wrong.

This looks fine tho!

@brettkolodny brettkolodny merged commit 570e42b into main Feb 19, 2025
30 checks passed
@brettkolodny brettkolodny deleted the brett/fix-health-render-logic branch February 19, 2025 20:09
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants