In antd, the `TimePicker` time selection box component that is looped through the array, if you locate the key in which it is located

  1. in antd, I want to loop out multiple < TimePicker / > components through an array, and when the component triggers onChange, pass the corresponding value setState to the corresponding subscript time .
  antd TimePicker  

As mentioned in the

document, the parameter of onChange is function (time: moment, timeString: string): void . You can only get time and timeString in change event China, but you cannot get the subscript key .

I don"t know if netizens have any whimsical tricks to get this value key?.

Mar.21,2021

onChange={ ()=>timeChange(item.key) }
Menu