Skip to content
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

fix(api): execute query inside onMounted to avoid SSR hydration issues #465

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

brc-dd
Copy link
Member

@brc-dd brc-dd commented Feb 5, 2024

No description provided.

@brc-dd brc-dd requested a review from kiaking February 5, 2024 04:47
Copy link

netlify bot commented Feb 5, 2024

Deploy Preview for sefirot-story ready!

Name Link
🔨 Latest commit ba4e402
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-story/deploys/65c0690a2ca0350008dd9a41
😎 Deploy Preview https://deploy-preview-465--sefirot-story.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brc-dd brc-dd self-assigned this Feb 5, 2024
@@ -61,3 +62,11 @@ export function useSlotValue(name = 'default'): ComputedRef<string | null> {
return v !== '' ? v : null
})
}

export function tryOnMounted(fn: () => void): void {
Copy link
Member Author

@brc-dd brc-dd Feb 5, 2024

Choose a reason for hiding this comment

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

Not using vueuse's version because it executes the function in SSR which is not expected. Also this version aligns better with vue as vue too doesn't run onMounted's callback in SSR.

Copy link

netlify bot commented Feb 5, 2024

Deploy Preview for sefirot-docs ready!

Name Link
🔨 Latest commit ba4e402
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-docs/deploys/65c0690a228cc50008bc2b56
😎 Deploy Preview https://deploy-preview-465--sefirot-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@kiaking kiaking left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Please merge at your convenience.

@brc-dd brc-dd merged commit db3cc44 into main Feb 5, 2024
9 checks passed
@brc-dd brc-dd deleted the fix/hydration branch February 5, 2024 05:08
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.

None yet

2 participants