-
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation 시뮬레이터 scrollView 오류 해결법React-native 2021. 8. 18. 23:39
React Native 작업 도중 시뮬레이터에서 해당 오류를 띄웠다.
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.
대강 해석해보자면
VirtualizedLists는 같은 방향으로 일반 ScrollView와 중첩되어서는 안된다.
ScrollView 안에 SectionList를 넣었더니 해당 오류가 나타났다. List는 일반 ScrollView에 넣으면 중첩되기 때문.
(왜 중첩이 되는지는 모르겠지만) 답은 간단하다.
plain ScrollView 내부에 Lists를 넣은 것이 문제니까, plain ScrollView 가 아니면 된다.
<ScrollView> 대신 <SafeAreaView>로 SectionList를 감싸주었더니 해결되었다.
'React-native' 카테고리의 다른 글
SectionList 뽀개기 (0) 2021.08.18 Objects are not valid as a React child 오류 해결법 (0) 2021.08.18 ScrollView horizontal 에 padding을 줄 경우 잘려서 보이는 문제 해결방법 (0) 2021.08.13 slide component 가로 스크롤 주의사항 (0) 2021.08.12 StackNavigator (0) 2021.08.12