ReactJS
React JS 태그 에러
개발하는 봉구
2021. 8. 18. 11:07
Do not pass children as props. Instead, nest children between the opening and closing tags react/no-children-prop
옛날 코드를 가지고 오던중에 해당 에러를 만났다.
<div
props1={props1}
props2={props2}
props3={props3}
children={
<div></div>
}
/>
기존 코드는 위와같이 Children props를 태그안에 보내는 형식이였는데 self closing 형태로 되어 있었다.
이 부분이 문제가 되었고 해당 코드를
<div
props1={props1}
props2={props2}
props3={props3}
children={
<div></div>
}
>
</div>
end tag 형태로 수정하여 에러를 잡았다.