반응형 버그1 리액트 Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it. // render() 부분 코드 일부 const inventoryListBySO = () => { let result = []; let numberForKey = 0; pricePolicyStore.selectedInventoryList.length > 0 && // ... 생략 }; // return() 부분 코드 일부 // 처음에 inventoryListBySO 라고만 선언함 {inventoryListBySO()} render() 부분에 함수를 선언하고, return 부분에서 이 함수를 실행을 안해줘서 생긴 버그다. 함수로 선언했으니까 당연히 실행을 해줘야 코드가 돌아가는데, 함수명만 선언해줘서 코드가 작동을 안했다. 참고한 사이트 https://kyounghwan01.github.io/blog/de.. 2021. 11. 15. 이전 1 다음 반응형