Skip to content

Commit

Permalink
ignore empty dep array in useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmister committed May 12, 2024
1 parent e6b7f2b commit 2da8c08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ export const Comments: React.FC<types.commentsProps> = ({ comments = initialComm

// Check if there are stored comments, otherwise use initial comments
setComments(storedComments || initialComments);
}, []); // Empty dependency array ensures this runs once on mount

// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);


return (
<div className="comments">
Expand Down

0 comments on commit 2da8c08

Please sign in to comment.