react-native-element-dropdown
react-native-element-dropdown copied to clipboard
How to pass already selected data?
Hi,
I've a dropdown component where i use react-native-element-dropdown for selecting branches when I try to create a new product. What I'm trying to achieve is to use the same screen for the product's edit. I already have a array of branches previously selected which I need to show as already selected along with my whole like.
I tried updating the array assigned as the value in the MultiSelect component. Is there a way to show selected data ?
Can you share your code? I had the same error just now, the problem I was I was assigning the value array with [{label:1,value:"Foo"}] . Changed the value array to just an array of values like ["Foo"] and it worked.
@BigDaddy-Zephyr I was doing the same thing with my value, I changed that to something like ["Foo"] now it's working like you said. Thanks for the help mate.
But theoretically it should work the other way around also right? 🤔 @hoaphantn7604
hi @premdasvm , Currently MultiSelect assigning value ["foo"]. I will upgrade this package to support both formats.