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

TypeError: Cannot read property 'getItem' of undefined #922

Open
3 tasks
aravi365 opened this issue Nov 22, 2023 · 1 comment
Open
3 tasks

TypeError: Cannot read property 'getItem' of undefined #922

aravi365 opened this issue Nov 22, 2023 · 1 comment
Labels

Comments

@aravi365
Copy link

aravi365 commented Nov 22, 2023

Describe the bug

TypeError: Cannot read property 'getItem' of undefined
Screenshot_1700652558

This error is located at:
in FlatList (created by GooglePlacesAutocomplete)
in RCTView (created by View)

Reproduction - When a character is entered in the searchbox this error is shown

Please provide a FULLY REPRODUCIBLE example.

<View style={styles.container}>
         <GooglePlacesAutocomplete
           autoFillOnNotFound
           placeholder="Search for places"
           minLength={2}
           ListEmptyComponent={renderEmptyComponent}
           renderLeftButton={() => (
             <SearchIcon
               width={wp(6)}
               height={hp(4)}
               style={styles.leftIcon}
             />
           )}
           renderRightButton={() => (
             <TouchableOpacity
               hitSlop={{top: 20, bottom: 20, left: 50, right: 50}}
               onPress={closeModal}>
               <ClockWithDropDown style={styles.rightIcon} />
             </TouchableOpacity>
           )}
           // suppressDefaultStyles
           query={{
             key: GOOGLE_MAPS_API_KEY,
             language: 'en'
           }}
           GooglePlacesDetailsQuery={{fields: 'geometry'}}
           fetchDetails={true} // you need this to fetch the details object onPress
           textInputProps={{
             autoFocus: true,
             returnKeyType: 'done',
             returnKeyLabel: 'done',
           }}
           styles={{
             textInputContainer: {
               width: wp(90),
               alignItems: 'flex-start',
               justifyContent: 'center',
               borderRadius: wp(2),
               shadowColor: colors.black,
               shadowOffset: {width: 0, height: 2},
               shadowOpacity: 0.2,
               shadowRadius: 2,
               elevation: 2,
               paddingHorizontal: wp(1),
               // borderWidth: 0.25,
             },
             textInput: {
               fontFamily: fonts.regular,
               color: colors.grapeBlack,
               paddingHorizontal: wp(6),
               height: hp(6),
             },
             separator: {
               // width: wp(100),
             },
             container: {
               // backgroundColor: colors.white,
               paddingHorizontal: wp(2),
               paddingTop: hp(5.8),

               // borderWidth: 1,
             },
           }}
           // renderLeftButton={() => (

           // )}
           onPress={(data, details = null) => {
             // Handle the selected place data
             console.log(data, details);
             closeModal(details?.geometry?.location);
           }}
         />
</View>

Additional context

  • Library Version: 2.5.6
  • React Native Version: 0.71.8

Issue in both Android and iOS

  • iOS
  • Android
  • Web
@aravi365 aravi365 added the bug label Nov 22, 2023
@AXUNDA
Copy link

AXUNDA commented Oct 18, 2024

has this been resolved?,i just ran into this same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants