Skip to content

Commit 295d3b7

Browse files
committed
remove timer
1 parent 8668894 commit 295d3b7

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/pages/ShowPage.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const ShowPage = () => {
99
const { id } = useParams();
1010
const [post, setPost] = useState(null);
1111
const [loading, setLoading] = useState(true);
12-
const [timer, setTimer] = useState(0);
1312
const isLoggedIn = useSelector(state => state.auth.isLoggedIn);
1413

1514
const getPost = (id) => {
@@ -19,17 +18,6 @@ const ShowPage = () => {
1918
})
2019
};
2120

22-
useEffect(() => {
23-
const interval = setInterval(() => {
24-
console.log('hello')
25-
setTimer(prev => prev + 1);
26-
}, 1000);
27-
28-
return () => {
29-
clearInterval(interval);
30-
}
31-
}, []);
32-
3321
useEffect(() => {
3422
getPost(id)
3523
}, [id])
@@ -45,7 +33,7 @@ const ShowPage = () => {
4533
return (
4634
<div>
4735
<div className="d-flex">
48-
<h1 className="flex-grow-1">{post.title} ({timer}초)</h1>
36+
<h1 className="flex-grow-1">{post.title}</h1>
4937
{isLoggedIn && <div>
5038
<Link
5139
className="btn btn-primary"

0 commit comments

Comments
 (0)