recently, I encountered a problem in my internship. I was a little annoyed, but I really couldn"t figure it out at the moment. React newcomer, want to come to the forum to ask the big gods what they think. "br > is like this. I now have a product table,table that has an interface to get data. The data is the id and related information of a group of goods. This data is changing all the time, so the number of these goods is also changing."
I just pass the product data into the subcomponent product cell, and product.map (product= > < ProductCell product= {product} / >) shows the product table.
now I need to have a small input box in the merchandise box product cell to fill in the numbers, and then there is a button in product table. I click this button, and I hope to get the input numbers of these goods and their corresponding id, in table. With such an array of ARRAY < order:Int, id: string >, I can sort in table, and then sort the sorted array with another api to save sorting information.
my question is: how do I get the information about the numbers in product cell in table? I know that setting call back in props allows a child component to send information to the parent component, but now there are multiple child components, the total number of which is uncertain, and the trigger condition for getting this information is whether or not to click the button in the table. I"m a little confused
if someone who is handsome and kind-hearted is willing to give advice, thank you very much.