Component - ScrollView component
The ScrollView component in React Native allows users to scroll through a list or content that is larger than the screen. It is like a window that lets you move up and down (or sideways) to see more content.
The ScrollView component in React Native allows users to scroll through a list or content that is larger than the screen. It is like a window that lets you move up and down (or sideways) to see more content.
View
└── ScrollView
├── Text (Item 1)
├── Text (Item 2)
├── Text (Item 3)
└── Text (Item 4)ScrollView component in React Native?ScrollView scroll horizontally?horizontal boolean prop to enable horizontal scrolling.import React from 'react';
import { ScrollView, Text } from 'react-native';
export default function App() {
return (
{[...Array(20)].map((_, i) => (
Item {i + 1}
))}
);
}key={i} and renders 20 Text items inside ScrollView.import React from 'react';
import { ScrollView, Text } from 'react-native';
export default function App() {
return (
Item 1
Item 2
);
}ScrollView without horizontal prop and render images vertically scrolls vertically, not horizontal as required. Use View with manual scrolling logic requires complex manual logic and is not recommended.Pass the test and this pattern moves unknown