react-native-modal-selector
react-native-modal-selector copied to clipboard
Option to format selected values
Hello,
first, let me thank you for this great project. It's really what we were looking for.
We want to use this component to create some kind of filter selection. The idea was that the component itself shows Filter by <anything>
and <anything>
is what the user should actually select in the dialog. Now our problem is that we can not differentiate between displayed label and lable within selection.
So my question is, if it is possible to differentiate between those two label locations?
The data passed to ModalSelector may contain anything you like. Taking the example from the Readme and modifying it:
const data = [
{ key: index++, section: true, label: 'Fruits', myCustomId: 98123 },
{ key: index++, label: 'Red Apples', myCustomId: 87943 },
{ key: index++, label: 'Cherries', myCustomId: 23590 },
];
With that example, you could use myCustomId
to uniquely identify the selected item. Does that solve your problem?