How can I iterate over an array to create a useState variable for each item?

后端 未结 0 1712
夕颜
夕颜 2021-01-17 04:38

Trying to do something like this.

const words = [\'tree\', \'dog\', \'table\']


words.forEach((word) => {
    const word = useState(`${word}`)
})
<         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题