Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes in production only - iOS #276

Open
arlindiDev opened this issue May 26, 2024 · 0 comments
Open

Crashes in production only - iOS #276

arlindiDev opened this issue May 26, 2024 · 0 comments

Comments

@arlindiDev
Copy link

Works in the Expo Go simulator for iOS. But crashes in production.
On iOS, it crashes when you try to open the dropdown.

I am building with eas build

To Reproduce

  • Use the basic setup guide to setup.
  • Open the component in a production version of the application.

Additional details

  • Device: iOS - Tested multiple devices with same issue.
  • OS: iOS 17.1.1
  • react-native-picker-select version: 2.12.0
  • react-native version: 0.73.6
  • expo sdk version: 50.0.17

Code

  const renderItem = (item, selected) => {
    return (
      <View style={ styles.itemBackground}>
        <View style={styles.item}>
          {/* <CountryFlag isoCode={item.value} size={12} /> */}
          <Text style={styles.textItem}>{item.label}</Text>
        </View>
      </View>
    );
  };
  
    const [country, setCountry] = useState("");
    const [items] = useState([
      { label: "United States", value: "us", index: 0 },
      { label: "Canada", value: "ca", index: 1 },
      { label: "United Kingdom", value: "gb", index: 9999 },
      // Add more countries as needed
    ]);
  
    <Dropdown
            style={[appStyle.dropdown]}
            placeholderStyle={styles.placeholderStyle}
            selectedTextStyle={styles.selectedTextStyle}
            selectedStyle={styles.selectedStyle}
            containerStyle={styles.containerStyle}
            itemContainerStyle={styles.itemContainerStyle}
            activeColor={"#000000"}
            data={items}
            maxHeight={300}
            labelField="label"
            valueField="value"
            placeholder={"Country"}
            value={country}
            onChange={(item) => {
              countryChange(item.value);
            }}
            renderItem={renderItem}
            renderRightIcon={() => (
              <Icon
                style={styles.iconStyle}
                name={"chevron-down"}
                size={20}
                color={country != "" ? "#000000" : "#6D6F78"}
              />
            )}
          />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant