react-native-bubble-select
react-native-bubble-select copied to clipboard
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
My code
const [cities] = React.useState([{id: '1', text: 'ciao1', color: 'red', selectedColor: 'blue', selectedScale: 1}]);
const [selectedCites, setSelectedCities] = React.useState<BubbleNode[]>([]);
const [removedCities, setRemovedCities] = React.useState<BubbleNode[]>([]);
const handleSelect = (bubble: BubbleNode) => {
setSelectedCities([...selectedCites, bubble]);
};
const handleDeselect = (bubble: BubbleNode) => {
setSelectedCities(selectedCites.filter(({ id }) => id !== bubble.id));
};
const handleRemove = (bubble: BubbleNode) => {
setRemovedCities([...removedCities, bubble]);
};
<BubbleSelect
onSelect={handleSelect}
onDeselect={handleDeselect}
onRemove={handleRemove}
width={width}
height={height}
fontName={Platform.select({
ios: 'SinhalaSangamMN-Bold',
})}
fontSize={16}
>
{cities.map(city => (
<Bubble
key={city.id}
id={city.id}
text={city.text}
color={city.color}
selectedColor={city.selectedColor}
selectedScale={city.selectedScale}
/>
))}
</BubbleSelect>
i'm getting this error on android but on iOS works perfectly my system details: How can i solve it?