You can consider this login component as similar to a controlled component. You set the internal state via the prop 'state' and any trigger inside the control calls the prop updateState with a actionType, value and prevState