To fix ScrollView Not scrolling with React Native, we wrap the content of the ScrollView with the ScrollView.
For instance, we write:
import * as React from 'react';
import { ScrollView, View, Text } from 'react-native';
import Constants from 'expo-constants';
import { Card } from 'react-native-paper';
export default function App() {
return (
<View style={{ flex: 1 }}>
<ScrollView>
{Array(200)
.fill()
.map((_, i) => {
return <Text>{i}</Text>;
})}
</ScrollView>
</View>
);
}
to wrap ScrollView
around the Text
components that we render inside.
Anything inside the ScrollView
will scroll.
As a result, we should see text inside and we can scroll up and down.