I need to set a state field which I get from an event, but it doesn\'t get set when I pass a function to it. The component and method looks like the following:
I came across similar warning message when filling components dynamically and to solve this I just had to wrap function with arrow function.
From:
{ text: "Delete item", onClick: deleteItem },
To:
{ text: "Delete item", onClick: (id) => deleteItem(id) },