TronNatthakorn / react-native-wheel-pick

Apache License 2.0
177 stars 85 forks source link

Error leaving an object selected by default. #26

Closed kelvindominguez1595 closed 1 year ago

kelvindominguez1595 commented 1 year ago

I am trying to use the component but with a normal string arrangement the selectedValue works but when using an array of objects and putting a string in this property it gives an error using typescript so when putting an object in the selectedValue it is solved but it does not leave the component selected correct object I leave you an example of how I want to use it:

<Picker
     style={{ backgroundColor: 'white', width: '80%', height: 215 }}
    selectedValue={{ value: '5765387680', label: 'item4' }}
    pickerData={[
            { value: '5765387677', label: 'item1' },
        { value: '5765387678', label: 'item2' },
        { value: '5765387679', label: 'item3' },
        { value: '5765387680', label: 'item4' },
        { value: '5765387681', label: 'item5' },
        { value: '5765387682', label: 'item6' },
        { value: '5765387683', label: 'item7' },
    ]}
    onValueChange={value => { console.log(value) }} />