DEV Community

Discussion on: Create simple login form in React

Collapse
 
diraskreact profile image
Dirask-React

Great question! 😊
The reason is to reduce our app re-renced cycles on state changes. Usually, states that describe inputs are updated when onChange event occurs that causes the whole component re-rendering on each small change (e.g. key press).

To get quicker answers you can ask in questions section on dirask.com/questions because I don't read the comments here every day 😊

Collapse
 
hey_yogini profile image
Yogini Bende

Absolutely. Component rerender becomes always a concern. I mostly use event.target.elements.inputname.value to get values from the form onSubmit. This is also good though.

Thanks for sharing.