by dounan · 9y ago · 0 comments
Yep
> Is there a better way?
We're experimenting with some other options internally. Once we have a better sense of what works best, we will post another article on our learnings :)
return ( <Data value={d} index={i} deleteDataAt={deleteDataAt} /> );
Then your onClick in the child would be: onClick = (_e) => this.props.deleteDataAt(this.props.index);
Correct me if I'm missing anything!
You're not missing anything :) That approach also works. The important point is that you have to pass the extra index prop down to the child to avoid the bind in render.