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

feat: add useHydrate to support ssr #70

Merged
merged 1 commit into from
Jun 16, 2023
Merged

feat: add useHydrate to support ssr #70

merged 1 commit into from
Jun 16, 2023

Conversation

jason89521
Copy link
Owner

Description

useHydrate will depend on the first argument (called data). It is the data you want to hydrate. you should make sure it is an object and cannot change with every render. It should either be the top level props (like nextjs's getServerProps) or be wrapped with react's useMemo.

The second argument is the update function. It will be executed whenever the first argument changes. Note that it will be invoked only once for each data.

Related Issue

#16

@jason89521 jason89521 merged commit f678d95 into main Jun 16, 2023
@jason89521 jason89521 deleted the feat/ssr branch June 16, 2023 05:38
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.

1 participant