arrowfunction1 [React] Binding 바인딩 우선, 리액트에서의 바인딩을 알아보기 전에 자바스크립트에서 "this"에 대한 이해가 되어있어야 리액트에서의 바인딩을 알 수 있습니다. 자바스크립트 바인딩 객체안의 메서드에서 this는 그 메서드가 포함된 object를 가리키게 됩니다. var obj = { prop: 'Hello', sayHello: function() { console.log( this.prop ); } }; // 1. obj.sayHello(); //"Hello" // 2. var reference = obj.sayHello; reference(); // undefined sayHello 메서드안의 this는 obj객체가 되어 obj.prop인 Hello를 전달받아 콘솔 로그를 출력합니다. 변수 reference에 담길 때 obj와.. 2019. 7. 26. 이전 1 다음