Skip to content

Commit

Permalink
fix: react hooks must be called in the exact same order in every comp…
Browse files Browse the repository at this point in the history
…onent render
  • Loading branch information
JohnsonMao committed Jun 9, 2024
1 parent a8158b4 commit 9b376eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/Profile/MyGroup/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ const StyledGroupsWrapper = styled.div`
`;

const MyGroup = ({ hasTitle = true, sx, userId }) => {
if (!userId) {
return <Typography py={7.5}>趕快發起屬於你的揪團吧~</Typography>;
}

const [response, setResponse] = useState(null);
const { isFetching } = useFetch(`/activity/user/${userId}`, {
enabled: !!userId,
Expand Down Expand Up @@ -74,6 +70,10 @@ const MyGroup = ({ hasTitle = true, sx, userId }) => {
});
};

if (!userId) {
return <Typography py={7.5}>趕快發起屬於你的揪團吧~</Typography>;
}

return (
<StyledGroupsWrapper sx={sx}>
{hasTitle && (
Expand Down

0 comments on commit 9b376eb

Please sign in to comment.