[React 99% 에러잡기] Error: Object are not valid as a React child (found: object with keys{result}). if you meant to render a collection of children, use an array instead.


[React 99% 에러잡기] Error: Object are not valid as a React child (found: object with keys{result}). if you meant to render a collection of children, use an array instead.

사건의 발단 CRA를 사용해서 React 개발 환경을 갖춘 뒤에 간단하게 '섭씨 온도'를 '화씨 온도'로 변경하는 계산기를 만들려고 했다. 섭씨 컴포넌트는 구현을 완료했고, 화씨 컴포넌트를 구현하던 중에 문제가 발생했다. 아래는 에러가 발생한 화씨 컴포넌트의 코드이다. 상위 컴포넌트로 부터 받은 데이터를 화씨 컴포넌트에서 출력하는 기능을 하는 소스 코드이다. const Fahrenheit=(props)=>{ return( 화씨 : {props} ) } 예상 외 전개 복잡하지도 않은 부분이었기 때문에 별 걱정이 없었다. 하지만, 화씨 컴포넌트 구현한뒤 확인한 브라우저는 된통 빨간색으로 도배되어 있었다...... *발 코드가 아예 200줄, 300줄이거나 로직이 복잡한 경우라면 그러려니 하면서 고치려 갔을거..


원문링크 : [React 99% 에러잡기] Error: Object are not valid as a React child (found: object with keys{result}). if you meant to render a collection of children, use an array instead.