Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

A ScrollView placed inside a View will not scroll in React Native

ErrorScrollView does not scroll

Short answer

A ScrollView only scrolls when its height is bounded. If any parent View has no flex or fixed height, the ScrollView grows to fit its content and has nothing to scroll. Pass flex: 1 down every parent. For a scroller inside another scroller on Android, set nestedScrollEnabled.

  • Applies to React Native 0.76+, Android API 21+, iOS 15+
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Turn on the element inspector and select the ScrollView. If its height equals its content height, a parent is not bounded. Or list the parents' styles.

    grep -n -B6 "<ScrollView" src/screens/*.tsx
  2. 2Match what you see, then jump to its fix

    1. 1The ScrollView is as tall as all its children, so it is clipped by the screen and never scrolls.A parent View has no bounded heightFix
    2. 2The inner scroller does not move on Android while the outer one takes the gesture.A vertical scroller inside another vertical scroller on AndroidFix
    3. 3Console error in development: VirtualizedLists should never be nested inside plain ScrollViews with the same orientationA FlatList is nested in a ScrollView with the same directionFix

What does the error look like?

  • ScrollView does not scroll
  • content is cut off at the bottom of the screen
  • VirtualizedLists should never be nested inside plain ScrollViews with the same orientation

Cause 1 of 3

A parent View has no bounded height

1Check

Walk up from the ScrollView to the screen root. Every View on the way needs flex: 1 or a fixed height.

grep -n "style={\|flex" src/screens/MyScreen.tsx

2Fix

Give each parent flex: 1 so the height passes down to the ScrollView. Setting a fixed height on the ScrollView also works but the docs discourage it.

<View style={{ flex: 1 }}>
  <View style={{ flex: 1 }}>
    <ScrollView>
      {/* content */}
    </ScrollView>
  </View>
</View>

3Verify

Reload and drag the content. The inspector now shows the ScrollView at screen height with taller content inside.

# Dev menu > Show Element Inspector

Confirmed by reactnative.dev

Did this fix it?

Cause 2 of 3

A vertical scroller inside another vertical scroller on Android

1Check

Look for a ScrollView within a ScrollView that scrolls in the same direction.

grep -n "ScrollView" src/screens/MyScreen.tsx

2Fix

Set nestedScrollEnabled on the inner ScrollView. It is Android only, API level 21 and up, and false by default.

<ScrollView>
  <ScrollView nestedScrollEnabled style={{ maxHeight: 240 }}>
    {/* inner content */}
  </ScrollView>
</ScrollView>

3Verify

On an Android device or emulator, drag inside the inner area. It scrolls on its own.

npx react-native run-android

Confirmed by reactnative.dev

Did this fix it?

Cause 3 of 3

A FlatList is nested in a ScrollView with the same direction

1Check

In dev builds React Native logs this error when a list is inside a plain ScrollView and the list can scroll.

grep -n -B3 "<FlatList" src/screens/MyScreen.tsx

2Fix

Use one scroller. Put the other content in ListHeaderComponent and ListFooterComponent of the FlatList and remove the outer ScrollView.

<FlatList
  data={items}
  renderItem={renderItem}
  ListHeaderComponent={<Header />}
  ListFooterComponent={<Footer />}
/>

3Verify

Reload in development. The error no longer appears and the whole screen scrolls.

npx react-native start --reset-cache

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Pass flex: 1 from the screen root down to every scroller.
  • Use one vertical scroller per screen and put extra content in list header and footer slots.
  • Test scrolling on Android and iOS, since nested behaviour differs.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

React Native FlatList warns that it is slow to update and scrolls with lag

make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.

React Native logs this message when scroll events arrive more than 500 ms apart on a list longer than five screens.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.