Passing array to component property in React

前端 未结 1 1384
小鲜肉
小鲜肉 2021-02-07 10:43

How can I pass an array to a component as a property. Neither of the following achieve what I am looking for. I want to pass the array of items through, manipulate them in the c

相关标签:
1条回答
  • 2021-02-07 11:26

    You need to use {} around js expressions:

    <List columns={['one', 'two', 'three', 'four']} />
    
    0 讨论(0)
提交回复
热议问题