How to deal with react-native-multiple-select getSelectedItemsExt() function?

1.2k Views Asked by At

I'm building a react native application and found out the react-native-multiple-select library which i emplemented following the documentation https://www.npmjs.com/package/react-native-multiple-select . The view is being displayed but the selected items are not showing up, only the counter of selected items works. I think it's because I don't have the control over how its function getSelectedItemsExt() works and from my researchs on internet like React-native-multiple-select: Cannot read the property 'getSelectedItemsExt' of undefined I only found that I should be doing

  <View>
       { this.multiselect
      ?
     this.multiselect.getSelectedItemsExt()
      :
      null}
    </View>

. Though it helped get rid of the red screen, it doesn't display the items. So can you please tell me how I can manage

this.multiselect.getSelectedItemsExt()

and get my items displayed. Any help is much appreciated. Thanks in advance.

1

There are 1 best solutions below

2
On BEST ANSWER

I can guess throughout the question that you are passing the hideTags props to the MultiSelect component i.e you are having inside the component <MultiSelect hideTags>. This hideTags was your problem because It does what it's name sounds, i.e it doesn't display the values you set in your FlatList or whatever component. If you want the values to be displayed then remove hideTags from inside the component and you should have your items displayed. Well you want also to customize the output of this library, it's colors and InputField style then head up to the root of your react native application, then go to node-module -> react-native-multiple-select -> Library there you will find the core file that you can customize at your leisure.