File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,12 @@ const FollowButton: React.FC<PostFollowButtonProps> = ({
25
25
const [ unfollow , { loading : loadingUnfollowUser } ] =
26
26
useMutation ( UNFOLLOW_USER ) ;
27
27
28
- const [ initialFollowState , setInitialFollowState ] = React . useState < boolean > ( ) ;
29
- const [ currentFollowState , setCurrentFollowState ] = React . useState < boolean > ( ) ;
28
+ const [ initialFollowState , setInitialFollowState ] = React . useState < boolean > (
29
+ ! ! followed ,
30
+ ) ;
31
+ const [ currentFollowState , setCurrentFollowState ] = React . useState < boolean > (
32
+ ! ! followed ,
33
+ ) ;
30
34
31
35
const [ buttonText , setButtonText ] = React . useState ( '팔로잉' ) ;
32
36
@@ -97,6 +101,8 @@ const FollowButton: React.FC<PostFollowButtonProps> = ({
97
101
setCurrentFollowState ( followed ) ;
98
102
} , [ followed ] ) ;
99
103
104
+ if ( followed === undefined ) return null ;
105
+
100
106
return (
101
107
< FollowButtonBlock
102
108
data-testid = "follow-btn"
You can’t perform that action at this time.
0 commit comments