const Demo = () => {
const refList = useRef([]);
return (
<>
{arr.map((item, idx) => (<A ref={node => { refList.current[idx] = node }} />))}
</>
)
}
//点击事件里拿到每个ref
const handleEdit = (index,item) => {
refList.current[index].focus({
cursor: 'end',
});
}