No worries, just wanted to chip in. Somehow dont see a note about rerender, I'm on mobile, perhaps some caching going on.
I like the alternative via name prop for input elements, or a custom data prop, as I wrote in the other comment thread.
Alternatively, I would still create a function property per onChange handler, but create and use a reusable function to limit the repetitiveness to the bare minimum.
No worries, just wanted to chip in. Somehow dont see a note about rerender, I'm on mobile, perhaps some caching going on.
I like the alternative via name prop for input elements, or a custom data prop, as I wrote in the other comment thread.
Alternatively, I would still create a function property per onChange handler, but create and use a reusable function to limit the repetitiveness to the bare minimum.
You can create a curried function and then memoize it. 😉 It should work! Have a look at Lodash's
curry
andmemoize
functions.