Skip to content

Commit

Permalink
check if data exists
Browse files Browse the repository at this point in the history
  • Loading branch information
EseAlli committed Feb 6, 2024
1 parent eff2231 commit be67dc5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pages/Team/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ const Team = () => {
}, []);

useEffect(() => {
const publishedTeamMembers = data.filter(
(member) => member.state === "published"
);
setTeamMembers(publishedTeamMembers);

if (data) {
const publishedTeamMembers = data.filter(
(member) => member.state === "published"
);
setTeamMembers(publishedTeamMembers);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLoading]);

Expand Down

0 comments on commit be67dc5

Please sign in to comment.