Error: input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.

hotbreakb·2022년 6월 4일
0

사용중인 것

  • styled-components
  • react-scroll

문제 상황

input은 없고 Button을 쓰고 있는데 이 에러가 났다.

import { Button } from "react-scroll";

...
  return (
    <Button
      to={String(currentQuestionIndex + 1)}
    >
      {content}
    </Button>
  );

에러 내용

styled-components에서 나는 에러인데, <input> 여기 안에 뭐기 들어있으면 안 된다고 </input> 말하고 있다.

children을 삭제하면 잘 돌아간다.

  return (
    <Button
      to={String(currentQuestionIndex + 1)}
    >
    </Button>
  );

react-scrollButtoninput이다 🤬 대환장 파티

이슈 등록을 하려고 했으나

만든 사람이 쌓인 이슈를 고칠 생각이 없는 거 같다.

라이브러리 쓰지 말고 내가 만들어야겠다.

profile
글쟁이 프론트 개발자, 헬렌입니다.

0개의 댓글