DEV Community

Suraj Sharma
Suraj Sharma

Posted on • Edited on

13 8

A Login Form built using React Hooks

Created a simple login form using React, Typescript and React Material UI featuring useReducer and useEffect hooks.

Login Form

A detailed article on How to build a React Login Form with Typescript and React hooks

Top comments (3)

Collapse
 
jrbell989 profile image
Jason Bell

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.

Collapse
 
fantasticsoul profile image
幻魂

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-...

Collapse
 
creativesuraj profile image
Suraj Sharma

Sure, I will look into it.
Thanks

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay