React — to Bind or Not to Bind
Luka Bracanovic
443

I/O like writing to the view is inherently impure so we have to come to terms with `this` (pun intended).

Worth a mention that in ES7, you’ll be able to “bind” your methods with arrow syntax like so:

exampleMethod = () => {
//this is bound to the class
}

Lastly worth a mention that alternative to simple binding we can use apply/call in-line of the component eventhandlers. This won’t result in the preemptive recall to any binds in the render layer.

Show your support

Clapping shows how much you appreciated Ryan Linnane’s story.