on master help sign in
Linting updates
afdb680Will Galebach
src/views/Invite/Cohort.tsx+6−10
@@ -1,4 +1,4 @@
1−import React, { useEffect, useCallback, useState } from 'react';
1+import React, { useEffect, useCallback, useMemo, useState } from 'react';
2import { Grid, Button } from 'indigo-react';
2import { Grid, Button } from 'indigo-react';
3import * as azimuth from 'azimuth-js';
3import * as azimuth from 'azimuth-js';
4import {
4import {
@@ -89,7 +89,10 @@ export default function InviteCohort() {
89 const [page, setPage] = useState(0);
89 const [page, setPage] = useState(0);
90
90
91 const { construct, unconstruct, completed, bind } = useIssueChild();
91 const { construct, unconstruct, completed, bind } = useIssueChild();
92− const invitePoints: Invite[] = invites[point.value] || [];
92+ const invitePoints: Invite[] = useMemo(() => invites[point.value] || [], [
93+ invites,
94+ point,
95+ ]);
93
96
94 // Set up the invite spawn if on L1
97 // Set up the invite spawn if on L1
95 useEffect(() => {
98 useEffect(() => {
@@ -233,14 +236,7 @@ export default function InviteCohort() {
233 setInviteGeneratingNum(0);
236 setInviteGeneratingNum(0);
234 };
237 };
235 generateAndDownload();
238 generateAndDownload();
236− }, [
237− getInvites,
238− setError,
239− setLoading,
240− setInviteGeneratingNum,
239+ }, [getInvites, setError, setLoading, setInviteGeneratingNum, point]);
241− currentL2,
242− point,
243− ]);
244
240
245 const goNextPage = useCallback(() => {
241 const goNextPage = useCallback(() => {
246 setPage(page + 1);
242 setPage(page + 1);