Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 #57

@acolomboNotomia

Description

@acolomboNotomia

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
MicrosoftTeams-image
my system details:
Schermata 2022-07-08 alle 13 15 14
How can i solve it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions