Skip to content

Commit

Permalink
usecallback for explore
Browse files Browse the repository at this point in the history
  • Loading branch information
hubsmoke authored and m0ar committed Sep 18, 2023
1 parent 74c186e commit 70e936e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pages/explore.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NextPage } from "next";
import { useEffect, useState } from "react";
import { useCallback, useEffect, useState } from "react";
import { useCeramicContext } from "@/context";
import { ROProps } from "@/types";
import Head from "next/head";
Expand All @@ -15,14 +15,14 @@ const ExplorePage: NextPage = () => {
const { composeClient } = clients;
const [objects, setObjects] = useState<ROProps[] | []>([]);

const getResearchObjects = async () => {
const getResearchObjects = useCallback(async () => {
const researchObjects = await queryResearchObjects(composeClient);
setObjects(researchObjects);
};
}, [composeClient]);

useEffect(() => {
getResearchObjects();
}, []);
}, [getResearchObjects]);

return (
<>
Expand Down

0 comments on commit 70e936e

Please sign in to comment.