Why setState not set appending my array into state?

后端 未结 3 854
别跟我提以往
别跟我提以往 2021-01-27 03:11

I have to create a text area which taken multiple links then I split() into array yeah Its working fine, but I want to set that array into my state in

3条回答
  •  长情又很酷
    2021-01-27 03:32

    setState is asynchronous. That means it doesn't happen right away, but a very short time later instead. If you add a:

    console.log(linkList)
    

    to the top of your render method, you will see the items being appended just as you expect.

提交回复
热议问题