In-depth explanation of state and props update in React