Problème de défilement vertical avec ScrollView dans React Native web #48390
Labels
Component: ScrollView
Needs: Author Feedback
Needs: Repro
This issue could be improved with a clear list of steps to reproduce the issue.
Newer Patch Available
Description
"Je développe une application React Native et j'ai des problèmes pour faire défiler la page. Lorsque je place mon contenu dans un ScrollView, la page ne défile pas correctement. J'ai essayé plusieurs solutions sans succès.
Steps to reproduce
import React from 'react';
import { View, Text, FlatList, ScrollView, StyleSheet } from 'react-native';
const data1 = [
{ id: '1', title: 'Item 1' },
{ id: '2', title: 'Item 2' },
{ id: '3', title: 'Item 3' },
{ id: '4', title: 'Item 4' },
];
const data2 = [
{ id: '1', title: 'Item A' },
{ id: '2', title: 'Item B' },
{ id: '3', title: 'Item C' },
{ id: '4', title: 'Item D' },
];
const App = () => {
const renderItem = ({ item }) => (
{item.title}
);
return (
Section 1
<FlatList
data={data1}
renderItem={renderItem}
keyExtractor={(item) => item.id}
horizontal
style={styles.flatList}
/>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f9f9f9',
},
header: {
fontSize: 24,
fontWeight: 'bold',
marginVertical: 10,
textAlign: 'center',
},
flatList: {
marginBottom: 20,
},
item: {
backgroundColor: '#007AFF',
padding: 10,
borderRadius: 5,
marginHorizontal: 10,
},
itemText: {
color: '#fff',
fontSize: 18,
},
text: {
padding: 20,
fontSize: 16,
textAlign: 'center',
},
});
export default App;
React Native Version
0.76.3
Affected Platforms
Runtime - Web
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/17nr6kODJCWa0F77zYi5b
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: