귤죠아
Home
  • 분류 전체보기 (12)
    • 🎡 (2)
    • FrontEnd (5)
      • HTML_CSS (0)
      • JS (1)
      • React (3)
    • Error (5)
Home
  • 분류 전체보기 (12)
    • 🎡 (2)
    • FrontEnd (5)
      • HTML_CSS (0)
      • JS (1)
      • React (3)
    • Error (5)
블로그 내 검색
Github

귤죠아

귤을 좋아하는 프론트엔드 개발자

  • Error

    [React] Warning: validateDOMNesting(...): div cannot appear as a child of table.

    2022. 11. 7.

    by. 귤죠아

    반응형

    현재 유지보수중인 프로젝트를 보다보면 Warning이 너무 많이 나와서 

    하나씩 수정해 보려고 한다.

    진짜 간단하게는 map등을 사용하면서 key값이 없는 경우도 있고, 뭐가 엄청 긴데 원인이 안보이는 경우도 있어서

    하나씩 수정하며 Warning내용을 정리 해보게 될 것 같다.

     

    물론 내가 추가 수정/개발하다가 나오는 에러들도 당욘히,,,,ㅎㅎㅎ

     

    에러 내용

    더보기

    Warning: validateDOMNesting(...): <div> cannot appear as a child of <table>.

     

    에러 이유

    • <table>태그 자식으로는 <div>태그가 올 수 없다.
    • style을 위해 margin을 table태그 안에 넣어둔 것 때문에 발생한 warning이었다

     

    수정 방법

    • table태그 밑 <thead>, <tbody>가 들어올 자리에 Margin용으로 만들어진 컴포넌트가 들어오고 있어,
      컴포넌트를 table태그 위로 올려줬다.

     

    참고 사이트

    • https://rrecoder.tistory.com/139
    반응형

    'Error' 카테고리의 다른 글

    [React] cross-env: command not found  (0) 2023.03.28
    [React] Warning: Each child in a list should have a unique "key" prop.  (0) 2022.11.09
    [React] Warning: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.  (0) 2022.11.08
    [파일질라] 서버 연결 실패 오류  (2) 2022.11.07

    댓글

    관련글

    • [React] cross-env: command not found 2023.03.28
    • [React] Warning: Each child in a list should have a unique "key" prop. 2022.11.09
    • [React] Warning: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`. 2022.11.08
    • [파일질라] 서버 연결 실패 오류 2022.11.07
    맨 위로
전체 글 보기
Tistory 로그인
Tistory 로그아웃
로그아웃 글쓰기 관리

Today

Total

Powered by ⓒ Kakao Corp.

Designed by Nana
블로그 이미지
귤죠아

티스토리툴바