The handleNameBlur
is used in another context (Class ExampleForm
) so you should bind it in ParentChecker to keep the context.
export default class ParentChecker {
constructor() {
this.data = {
'foo': 'bar',
};
this.handleNameBlur = this.handleNameBlur.bind(this);
}
handleNameBlur(e) {
console.log(this.data); // <=== "this" result to undefined.
/* ... */
}
}
CLICK HERE to find out more related problems solutions.