I'm currently starting a project to apply something I just learned, but I will probably get bored in a couple days once I finish applying my learnings. It doesn't matter when you read this.
Having a function defined as function onChange(event), and passing it to the element as onChange={onChange}.
The thing here is that I didn't want to make it more complex, because it's just one input and one button, so that did the trick. If there were more elements involved, with a more complex form, I would've handled it using event handlers.
You gave me an idea, I'll try to write a post on how to handle complex forms during this week!
Thanks for pointing that out!
Regards.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The recommended way is to use event handlers.
Having a function defined as
function onChange(event)
, and passing it to the element asonChange={onChange}
.The thing here is that I didn't want to make it more complex, because it's just one input and one button, so that did the trick. If there were more elements involved, with a more complex form, I would've handled it using event handlers.
You gave me an idea, I'll try to write a post on how to handle complex forms during this week!
Thanks for pointing that out!
Regards.