[React][에러해결] Objects are not valid as a React child (found: object with keys {_h, _i, _j, _k}).
Objects are not valid as a React child (found: object with keys {_h, _i, _j, _k}). If you meant to render a collection of children, use an array instead.
이 에러는 맞지 않는 타입의 데이터를 렌더링해서 발생한다.
나같은 경우에는 컴포넌트에 객체 자체를 전달하려고 해서 발생했다.
컴포넌트에는 배열이나 문자열을 전달해야 한다.
오류가 난 코드.
이렇게 객체 자체를 컴포넌트에 전달할 수 없다.
const objectData = { name: 'name', value: 'value' };
return <Component prop={objectData} />;
const objectData = { name: 'name', value: 'value' };
return <Component name={name} value={value} />;
고친 코드.
객체속성을 이용해야한다.
| [React][에러해결] Maximum update depth exceeded 오류 (0) | 2023.11.23 |
|---|---|
| [React][에러해결] Execution failed for task ':app:installDebug' (0) | 2023.11.06 |
| [React native] 사용자의 기기 정보 가져오기 (0) | 2023.11.06 |
| [React][에러해결] Text strings must be rendered within a <Text> component (0) | 2023.11.06 |
| [React][에러해결] 함수에서 useState사용시 Invalid hook call (0) | 2023.11.06 |
댓글 영역