(no title)
dounan
|
8 years ago
The reason arrow functions and bind don't play well with PureComponents is that they return a new function instance each time. This means that the Data pure component will wastefully re-render even if none of the other props change.
abritinthebay|8 years ago
If you did this.foo = this.foo.bind(this, props.bar) in the constructor then it would be the same function each time.
dounan|8 years ago
In general binding like that in the constructor works only if you depend on props, but at that point, there isn't a need to bind at all since you can just reference the prop in the callback.
aidos|8 years ago