maxkordiyak / react-native-dropdown-autocomplete

Autocomplete input with dropdown modal component for React native. Useful for pages with multiple autocomplete's.
MIT License
100 stars 51 forks source link

[question] Is it possible to use with fixed content #2

Closed Xyzor closed 5 years ago

Xyzor commented 5 years ago

I'd like to use the module with a fixed array, without calling any api.

Is it possible?

maxkordiyak commented 5 years ago

@Xyzor Hi thanks for your message! I will update the library with ability to add a fixed array of items shortly.

maxkordiyak commented 5 years ago

@Xyzor you can now define a fixed array of items like this

const data = [
  "Apples",
  "Broccoli",
  "Chicken",
  "Duck",
  "Eggs",
  "Fish",
  "Granola",
  "Hash Browns",
];

then change your valueExtractor and pass the data to Autocomplete without fetchDataUrl <Autocomplete data={data} valueExtactor={item => item} />

Xyzor commented 5 years ago

Awesome.

I'll leave this open for README update.

maxkordiyak commented 5 years ago

added Usage without data-driven content in readme.