diff --git a/webclient/src/Comments.js b/webclient/src/Comments.js index 1e1f385..ce63fe8 100644 --- a/webclient/src/Comments.js +++ b/webclient/src/Comments.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useCallback } from 'react'; +import React, { useState, useEffect } from 'react'; import { Link, useParams } from 'react-router-dom'; import { HashLink } from 'react-router-hash-link'; import { Helmet } from 'react-helmet'; @@ -58,17 +58,17 @@ function Comments({ cache }) { ); }, [id]); - const collapseComment = useCallback((cid) => { + const collapseComment = (cid) => { setCollapsed(prev => [...prev, cid]); setExpanded(prev => prev.filter(x => x !== cid)); - }, []); + }; - const expandComment = useCallback((cid) => { + const expandComment = (cid) => { setCollapsed(prev => prev.filter(x => x !== cid)); setExpanded(prev => [...prev, cid]); - }, []); + }; - const displayComment = useCallback((story, c, level) => { + const displayComment = (story, c, level) => { const cid = c.author+c.date; const isCollapsed = collapsed.includes(cid); @@ -99,7 +99,7 @@ function Comments({ cache }) { } ); - }, [collapsed, expanded, collapseComment, expandComment]); + }; return (