강의

멘토링

커뮤니티

Inflearn Community Q&A

sajacaros's profile image
sajacaros

asked

Learn React and Firebase by following along - Creating a Chat Application [Renewed in December 2023]

Create a ChatRoom

ChatRoom 생성하기 관련 질문

Written on

·

241

1

채팅룸 만드는 모달창에서

handleSubmit 함수를 form과 button에 같이 걸어두는 이유는 무엇인가요?

웹앱firebasereact

Answer 1

0

Form 에서 enter를 눌렀을 때 이벤트 처리 할려고 넣은거 같습니다.

submit버튼이 없으면 동작을 안해서 Form안에 아래와 같이 넣고 텍스트 입력후 Enter를 누르면 해당 onSubmit액션이 발생됩니다.

<Button style={{ display: "none" }} type="submit">Submit form</Button>

sajacaros's profile image
sajacaros

asked

Ask a question