Please see the picture below.
Is there a way to create a single function that will update the states without creating three separate functions. I want the function to use the name of the ref or maybe classname to update the corresponding state with its values.