---
title: "How does ScrollView work in React Native?"
description: "ScrollView renders all its children at once. Learn its main props, how to size it, and when to use FlatList instead for long lists."
url: "https://bugsee.com/answers/react-native/react-native-scrollview-explained/"
---

# How does ScrollView work in React Native?

`ScrollView` makes its content scrollable but renders every child immediately, so use it for short content and switch to `FlatList` for long or unknown-length lists.

```tsx
import { ScrollView, RefreshControl, Text } from 'react-native';

<ScrollView
  style={{ flex: 1 }}                          // the scroll view itself needs a bounded height
  contentContainerStyle={{ padding: 16 }}      // styles the inner content, not the viewport
  showsVerticalScrollIndicator={false}
  keyboardShouldPersistTaps="handled"          // taps reach buttons while the keyboard is open
  refreshControl={<RefreshControl refreshing={loading} onRefresh={reload} />}
>
  <Text>Short, fixed content goes here.</Text>
</ScrollView>

// Horizontal
<ScrollView horizontal showsHorizontalScrollIndicator={false}>{chips}</ScrollView>
```

- If nothing scrolls, the parent usually has no fixed height. Give the scroll view or its parent `flex: 1`.
- Put padding in `contentContainerStyle`, not `style`, so it scrolls with the content.
- Do not nest a vertical `ScrollView` inside another one with the same direction; use one scrolling container.
- For long lists, `FlatList` renders only what is visible and recycles rows.

## Related questions

- [How do you clear the Metro bundler cache in React Native?](https://bugsee.com/answers/react-native/clear-the-metro-cache/)
