Answers for "how we use usefef in map function"

0

how we use usefef in map function

const Component = () => 
{

  // In `items`, I would like to get an array of DOM element
  let items = useRef(null);

  return <ul>
    {['left', 'right'].map((el, i) =>
      <li key={i} ref={items} children={el} />
    )}
  </ul>
}
Posted by: Guest on July-30-2021

Code answers related to "how we use usefef in map function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language