markdown guide
 

I've found that when using multiple useState hooks, it becomes easier to move to useReducer, especially when conditions mutate multiple pieces of state. I think useState still works well in your example, but once you build a more complex login (with 2FA, requiring a new user to set a new password, etc), it can get messy quickly.

 

you can also refactor your from with concent, it is worth doing.
here is 2 demos:
js ver: codesandbox.io/s/concent-guide-xvcej
ts ver: codesandbox.io/s/concent-guide-ts-...

 
Classic DEV Post from Jul 2

How to refill someone’s “cup?”

Sometimes we rely so much on our friends and coworkers that we often forget to ma...

Suraj Sharma profile image
I am a full stack developer with 6 years of experience in building web apps from scratch. React, Typescript, Flask.

Creating your DEV account literally takes 30 seconds and is one of the best moves you can make for a happy and healthy software career.

Get started now ❤️