Bind Picker to list of Picker.Item in React Native

后端 未结 6 1734
一向
一向 2020-12-24 14:05

I\'m sure there is a way to do this, but I just can\'t see how yet.

What I\'d like to do, is add a Picker component, but rather than hard-code the list of items, fet

6条回答
  •  太阳男子
    2020-12-24 14:43

    IMPORTANT: if you try to iterate an array of numbers with map then don't forget that label property of Picker.Item should be converted to string:

    const pickerItems = [1,2,3].map(i => (
          
    ));
    

提交回复
热议问题