Normal function vs Arrow Function
일반 함수 vs 화살표 함수
class App extends Component<AppProps, AppState> {
constructor(props) {
super(props);
this.state = {
name: 'React'
};
this.hello = this.hello.bind(this);
}
hello(){
alert(this.state.name)
}
render() {
return (
<div onClick={this.hello}>
hello worlld
</div>
);
}
}Last updated