DEV Community

Discussion on: How To Create Forms In React ? - Controlled Inputs & Material UI

Collapse
 
ash_bergs profile image
Ash

Enlightening read! Did you make the choice to use class components for Form and Profile for any special reason? Always curious about the thoughts behind the patterns.

Thanks for the write up!

Collapse
 
lucciddev profile image
lucciddev

I was wondering as well, considering the fact that hooks are popular this days. Really nice pattern though , would try it out using hooks.

Collapse
 
cyberwolves profile image
CyberWolves

I have used class components because it makes our code less and clean. Accessing parent functions in class component is easy as cake and if we want to change something in future there is only place to modify.

Collapse
 
piotrlewandowski profile image
Piotr Lewandowski

"it makes our code less and clean" - it's exactly the opposite - functional components create less footprint - both in a source code and in transpiled code, no more 'this' confusion, they're much easier to read and to test them...