Skip to content

Commit

Permalink
replace useMemo with useCallback to prevent usePositions repeat…
Browse files Browse the repository at this point in the history
…edly re-rendering pages
  • Loading branch information
eli-d committed Aug 19, 2024
1 parent 411071c commit a2e6a08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/hooks/usePostions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Token } from "@/config/tokens";
import { graphql, useFragment } from "@/gql";
import { useGraphqlUser } from "@/hooks/useGraphql";
import { useMemo } from "react";
import { useCallback } from "react";
import { create } from "zustand";
import { persist } from "zustand/middleware";

Expand Down Expand Up @@ -120,7 +120,7 @@ export const usePositions = () => {
const { positions, updatePositionLocal, updatePositionsFromGraph } =
usePositionStore();

useMemo(
useCallback(
() =>
positionsData &&
updatePositionsFromGraph(
Expand Down

0 comments on commit a2e6a08

Please sign in to comment.