2

I need to attach a function to a specific button. Actually a have lots of them, 2 per each element. And I just don't know how to pass variable to function not triggering it when rendering. Any one knows how?)

Task text={data.text} onClick={deleteItem(store, index)} 

The function is to delete element from array

Paul Fitzgerald
  • 11,770
  • 4
  • 42
  • 54
  • You don't; you create a function with the values already bound, which could be as simple as an immediate anonymous function. Passing in the store makes it look like you're not using any sort of Flux-ish pattern, which somewhat reduces your options. – Dave Newton Dec 13 '16 at 11:42

0 Answers0