reactjs; after mapping an array nothing renders

后端 未结 3 1452
长情又很酷
长情又很酷 2021-01-15 10:58

I have an input that after the user inserts a text I want to show each word in a button in button-group. I split the sentence and map it that returns



        
3条回答
  •  余生分开走
    2021-01-15 11:56

    You will need to return a value from your function like so:

       mapArrayToButtons(){
            return this.state.textArr.map((word)=>{
                return();});
        }
    

    Hope that helps!

提交回复
热议问题