showing results for - "how we use usefef in map function"
Aliya
06 Mar 2017
1const Component = () => 
2{
3
4  // In `items`, I would like to get an array of DOM element
5  let items = useRef(null);
6
7  return <ul>
8    {['left', 'right'].map((el, i) =>
9      <li key={i} ref={items} children={el} />
10    )}
11  </ul>
12}
13