How does react updates counter variable when used in useState hook - Kevin Powell - Community