please check below sample.
Here you can see a "increment counter" button which is incrementing a state value.
https://codesandbox.io/s/ag-grid-react-hooks-problem-forked-zj4vr?file=/src/index.js
But when i click a button inside of grid, i can't see current value of state. Always returning first defined value (which is defined by useState)
Notice: This state doesn't defined for each row. I have only 1 state for component and i want to access value of state from cellbutton's click event.
is this a bug?
Clarifying comments for the question:
I think this is a case of stale closure: Stale Closure
Helpful thread: Stack Overflow