How to add the array to useState correctly?

前端 未结 0 594
夕颜
夕颜 2020-12-29 06:08

I define a state like this:

const [user, setUser] = useState( [] as { userId: string; userHabbitList: string[] }[], )

My API will be like this:

         


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