top | item 14418657 (no title) zevyoura | 8 years ago You can partially apply the function where you know the parameter; i.e. assign onDelete to: this.handleDelete.bind(this, i) discuss order hn newest 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 Only if you did that in the render function.If you did this.foo = this.foo.bind(this, props.bar) in the constructor then it would be the same function each time. load replies (2)
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 Only if you did that in the render function.If you did this.foo = this.foo.bind(this, props.bar) in the constructor then it would be the same function each time. load replies (2)
abritinthebay|8 years ago Only if you did that in the render function.If you did this.foo = this.foo.bind(this, props.bar) in the constructor then it would be the same function each time. load replies (2)
dounan|8 years ago
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.