๐Ÿ“Event Method์˜ ๋ฐ”์ธ๋”ฉ

๋”ฑ์ดยท2021๋…„ 4์›” 4์ผ
0
post-custom-banner

constructor (props) {
    super(props);
    this.handleChange = this.handleChange.bind(this);
}

handleChange (e) {
    console.log(e.target.value);
} 

Property Initializer Syntax๋ฅผ ์‚ฌ์šฉํ•œ ๋ฉ”์„œ๋“œ ์ž‘์„ฑ

์ƒˆ ๋ฉ”์„œ๋“œ๋ฅผ ๋งŒ๋“ค๋•Œ ๋งˆ๋‹ค constructor๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•˜๋Š” ๋ฒˆ๊ฑฐ๋Ÿฌ์›€์„ ๋œ๊ธฐ ์œ„ํ•จ.
babel์˜ transform-class-properties๋ฌธ๋ฒ•์„ ์‚ฌ์šฉํ•ด ํ™”์‚ดํ‘œ ํ•จ์ˆ˜๋กœ ๋ฉ”์„œ๋“œ๋ฅผ ์ •์˜ํ•œ๋‹ค.

handleChange = (e) => {
    console.log(e.target.value);
} 

p.130 - 132

profile
๋š๋”ฑ๋š๋”ฑ FE
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€