[TIL] 220502

Bora Im·2022년 5월 2일
0

next/link 공식 문서


오늘 만난 에러😍

You provided a checked prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultChecked. Otherwise, set either onChange or readOnly.
onChange 핸들러가 없는 양식 필드에 checked 프로퍼티를 전달하면 읽기 전용(readOnly) 필드가 렌더링됩니다. 필드를 변경할 수 있어야 하는 경우 defaultChecked를 사용합니다.
다른 방법으로는 onChange 또는 readOnly를 설정합니다.

Checkbox contains an input of type checkbox with both checked and defaultChecked props.
Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both).
Decide between using a controlled or uncontrolled input element and remove one of these props.
둘 중 하나만 선택하시오. 둘 다 쓰기 금지!

React does not recognize the useToggle prop on a DOM element.
If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase usetoggle instead.
If you accidentally passed it from a parent component, remove it from the DOM element.
리액트는 DOM 엘리먼트에 useToggle prop 을 적용하지 못한다. 커스텀 속성으로 DOM에 적용되길 원한다면 소문자로 고치고 잘못 내린거면 지우세요.

Received true for a non-boolean attribute toggle.
If you want to write it to the DOM, pass a string instead: toggle="true" or toggle={value.toString()}.
boolean 속성이 아닌데 true 를 받다니.. DOM에서 사용하고 싶다면 문자열 리터럴로 내리세요.


defaultProps

How to declare default props in react functional component


0개의 댓글