DEV Community


Discussion on: I learned React Hooks and now I'm the happiest dev on the planet! 🌎

isaachatilima profile image
Isaac Hatilima

Hi Brayden, is there a way of having less code in your Where you have
const onNameChange = e => {
Does that mean you will have to repeat that code structure for however many input fields you have?

braydentw profile image
Brayden W ⚡️ Author

No, this function is only for changes to inputs with for the name. I only have one.

Then there is another function for the tag radio buttons.

hnrq profile image
Henrique Ramos

How's it going, Isaac? I think you can make a custom hook for input fields. This is mentioned in some articles and Dan Abramov also creates one of those on "React Today and Tomorrow and 90% Cleaner React With Hooks".