• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    해결됨

[React.js] onUpdate is not a function

19.02.08 14:11 작성 조회수 349

0

TypeError: onUpdate is not a function

PhoneInfo._this.handleToggleEdit

16 | handleToggleEdit = () => {

17 | const {info, onUpdate} = this.props;

18 | if(this.state.editing){

19 | onUpdate(info.id, {

20 | name: this.state.name,

21 | phone: this.state.phone,

22 | });

실습중 이렇게 에러가 뜨는데 원인을 잘 모르겠습니다 ㅠㅠ

답변 1

답변을 작성해보세요.

2

Daehun Kim님의 프로필

Daehun Kim

2020.06.09

이게 아마 PhoneInfoList 에서 onUpdate를 안줘서 그럴 거에요!! :)

PhoneInfo

onUpdate={onUpdate}
onRemove={onRemove}
info={info}
key={info.id}
/>