siemiatj / react-native-modal-dropdown

Fork of the original https://github.com/sohobloo/react-native-modal-dropdown
MIT License
118 stars 98 forks source link

TypeError: undefined is not an object (evaluating 'dropdownListProps.ListHeaderComponent') #72

Open samih-sghier opened 2 years ago

samih-sghier commented 2 years ago

Getting the following error: TypeError: undefined is not an object (evaluating 'dropdownListProps.ListHeaderComponent')

The component was working fine until recently. After debugging the issue is coming from the "options" prop. This is what my code looks like: <ModalDropdown options={housingType} defaultValue={optionLeft || 'Type'} onSelect={(itemValue) => this.handleChangeHousingType(itemValue, dispatch)} />

silldepair commented 2 years ago

same problem, so is there any fix ?

ahmed563 commented 1 year ago

@samih-sghier This should fix it: <ModalDropdown dropdownListProps={{}} options={housingType} defaultValue={optionLeft || 'Type'} onSelect={(itemValue) => this.handleChangeHousingType(itemValue, dispatch)} />

i.e. by adding dropdownListProps={{}}

prathik-s commented 1 year ago

@ahmed563 The problem still persists even after adding dropdownListProps={{}}.