Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

313
Views
React-native-google-places-autocomplete does not work in a Scroll View? VirtualizedLists should never be nested inside plain ScrollViews ERROR

This one was already discussed, but from I was able to see there is still no available solution for the issue. I have read all the documents regarding the matter. The error I am getting is: "VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead" In the official documents on the plugin, it is suggested application of <ScrollView keyboardShouldPersistTaps={'handled'}>. However, this does not fix the issue. How can I display it inside the Scroll view? Below is my code Thanks

import React from 'react';
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';
export const GooglePlacesInput = () => {
  return (  
    <GooglePlacesAutocomplete
      placeholder='Search'
      onPress={(data, details = null) => {
        // 'details' is provided when fetchDetails = true
        console.log(data, details);
      }}
      query={{
        key: 'my Key',
        language: 'en',
      }}
    />
  );
};

And I want to display it inside the scroll view

export const IznajmiScreen = () => ( 
  <>
  <IznajmiListContainer>
    <ScrollView keyboardShouldPersistTaps={'handled'} >
      <TextInput style={styles.input} placeholder="Naslov" /> 
      <MyDatePickerStart/>
      <MyDatePickerEnd/>
      <GooglePlacesInput/>
      </ScrollView>
  </IznajmiListContainer>
  </>
)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found the solution but first do not add this,

import { LogBox } from 'react-native';

LogBox.ignoreLogs(['VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.']);

to your code. You are simply shutting up your application from warning you about errors.

Simply add "horizontal={true}" to any ScrollView wrapping your component like this.

<ScrollView
   horizontal={true}
   nestedScrollEnabled={true}
   keyboardShouldPersistTaps='handled'
   contentContainerStyle={{ flexGrow: 1 }}
>
   <GooglePlacesAutocomplete/>
</ScrollView>

Happy coding from Nigeria :).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!