Skip to content

Commit

Permalink
fix(hydration): useMemo -> useEffect (#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
AjaxSolutions committed Jan 15, 2021
1 parent e9208b2 commit 5f04615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hydration/react.tsx
Expand Up @@ -11,8 +11,8 @@ export function useHydrate(state: unknown, options?: HydrateOptions) {

// Running hydrate again with the same queries is safe,
// it wont overwrite or initialize existing queries,
// relying on useMemo here is only a performance optimization
React.useMemo(() => {
// relying on useEffect here is only a performance optimization
React.useEffect(() => {
if (state) {
hydrate(queryClient, state, optionsRef.current)
}
Expand Down

1 comment on commit 5f04615

@vercel
Copy link

@vercel vercel bot commented on 5f04615 Jan 15, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.