react-native-bottom-sheet-dropdown 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,10 +56,10 @@ const DropdownModal = ({ data, visible, onClose, onSelect, dropdownModalProps, s
56
56
  react_1.default.createElement(react_native_1.Text, { style: styles.dropdownTitle }, (_f = dropdownModalProps === null || dropdownModalProps === void 0 ? void 0 : dropdownModalProps.dropdownProps) === null || _f === void 0 ? void 0 : _f.dropdownTitle),
57
57
  react_1.default.createElement(react_native_1.TouchableOpacity, { onPress: onClose },
58
58
  react_1.default.createElement(react_native_1.Text, { style: styles.close }, (_g = dropdownModalProps === null || dropdownModalProps === void 0 ? void 0 : dropdownModalProps.dropdownProps) === null || _g === void 0 ? void 0 : _g.closeTitle))),
59
- react_1.default.createElement(react_native_1.ScrollView, { style: styles.scrollView, showsVerticalScrollIndicator: false }, data.map((item) => {
59
+ react_1.default.createElement(react_native_1.ScrollView, { style: styles.scrollView, showsVerticalScrollIndicator: false }, data.map((item, index) => {
60
60
  var _a, _b;
61
61
  const isSelected = (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === item.value;
62
- return (react_1.default.createElement(react_native_1.Pressable, { key: item.value, style: styles.optionContainer, onPress: () => {
62
+ return (react_1.default.createElement(react_native_1.Pressable, { key: (item === null || item === void 0 ? void 0 : item.key) || index, style: styles.optionContainer, onPress: () => {
63
63
  onSelect(item);
64
64
  onClose();
65
65
  } },
package/lib/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ViewStyle, TextStyle } from "react-native";
2
2
  export interface DropdownItem {
3
+ key: string;
3
4
  label: string;
4
5
  value: string;
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-bottom-sheet-dropdown",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A dropdown component with bottom sheet UI for React Native",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",