diff --git a/apps/blog/src/components/CommentForm/index.tsx b/apps/blog/src/components/CommentForm/index.tsx index 6dc00bb..7c3dd80 100644 --- a/apps/blog/src/components/CommentForm/index.tsx +++ b/apps/blog/src/components/CommentForm/index.tsx @@ -21,7 +21,7 @@ interface CommentFormProps { const cx = classNames(styles, "comment-form"); function CommentForm({ slug, submit, isClientSide = false }: CommentFormProps) { - const [name, setName] = useState("익명"); + const [name, setName] = useState(generateRandomName()); const [body, setBody] = useState(""); const formRef = useRef(null); @@ -88,6 +88,9 @@ function CommentForm({ slug, submit, isClientSide = false }: CommentFormProps) { onChange={({ currentTarget: { value } }) => { setName(value); }} + onFirstFocus={() => { + setName(""); + }} >