Managing State in react using different method, & understand batching