From the below code, while i do call the setSnake function with newer array , the snake variable ( state var ) does not update post the First key press... on further key pre