• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 React 게시판 특정 컴포넌트 수정 후 저장 시 중복 렌더링

특정 컴포넌트 수정 후 저장 시 중복 렌더링

  • 이 주제에는 1개 답변, 2명 참여가 있으며 codingapple3 년 전에 전에 마지막으로 업데이트했습니다.
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 글쓴이
  • #41882

    조윤상
    참가자
    function Search(){
      render(
        <>
          <section className="py-5" style={{paddingBottom: "12rem !important"}}>
            <div className="container px-5">
              <div className="bg-white rounded-3 py-5 px-4 px-md-5 mb-5">
                  <div className="text-center mb-5">
                      <div className="feature bg-dark bg-gradient text-white rounded-3 mb-3"><i className="bi bi-search"></i></div>
                      <h2 className="fw-bolder">신청현황 조회</h2>
                      <p className="lead fw-normal text-muted mb-0">접수시 입력하신 성함과 전화번호를 입력해주세요.</p>
                  </div>
                  <div className="row gx-5 justify-content-center">
                      <div className="col-lg-8 col-xl-6">
                        <form>
                            <div className="form-group">
                                <label htmlFor="inputName">신청자명</label>
                                <input type="text" className="form-control" name="name" placeholder="입력해주세요" required />
                                <small className="form-text text-muted"></small>
                            </div>
                            <div className="form-group mb-3">
                                <label htmlFor="fff" >연락처</label>
                                <div className="d-flex flex-row justify-content-between align-items-center">
                                    <input type="text" className="form-control" readOnly defaultValue="010"/>
                                    &nbsp;-&nbsp;
                                    <input type="text" className="form-control"/>
                                    &nbsp;-&nbsp;
                                    <input type="text" className="form-control"/>
                                </div>    
                            </div>
                            <div className="d-grid"><button className="btn btn-dark btn-lg disabled" type="submit">조회</button></div>
                          </form>
                      </div>
                  </div>
              </div>
            </div>
          </section>
        </>
      )
    }
    
    위와같은 부트스트랩을 이용한 컴포넌트가 있는데 다른 부분은 문제가 없는데
    
    이 부분에서 수정 후 저장 시 브라우저에서 저장 횟수 만큼 같은 컴포넌트가 렌더링 됩니다.
    
    새로고침을 하게 되면 아무것도 렌더링 되지 않는 화면이 출력되고 
    
    vscode에서 스페이스 입력후 저장하면 다시 같은 컴포넌트가 여러번 렌더링 되어있습니다.....
    
    어찌해야합니까ㅜㅜ
    #41928

    codingapple
    키 마스터
    컴퓨터 껐다켭시다 
    아니면 다른 곳이 이상해서 그럴 수도 있습니다 크롬 콘솔창 확인해봅시다
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관, 개인정보처리방침
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠