강의

멘토링

커뮤니티

Inflearn Community Q&A

ctyyc1956's profile image
ctyyc1956

asked

React for Everyone: React Core Course for Beginners

Modifying data in an array

[React.js] onUpdate is not a function

Resolved

Written on

·

539

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 | });

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

javascriptreact

Answer 1

2

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

PhoneInfo

onUpdate={onUpdate}
onRemove={onRemove}
info={info}
key={info.id}
/>
ctyyc1956's profile image
ctyyc1956

asked

Ask a question