I am having a callback function which updates my array in the SetState and it works fine as I can see in the console log. But when I try to access it in another function i.e ha