| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- SWIFT
- 앱 비교 프로젝트
- 신입ios개발자회고
- sqoop
- Swift 문법
- Swift 기능
- swift문법
- 네이버 부스트캠프
- react
- 애플 디벨로퍼 아카데미
- ios개발자
- 개발회고
- 데이터베이스
- 신입 ios 개발자
- 애플 디벨로퍼 아카데미 후기
- Swift 디자인패턴
- global soop
- 신입 개발자
- 네이버 치지직
- OS
- 운영체제
- 소프트웨어분석및설계
- 애플 아카데미 후기
- 숭실대
- Apple Developer Academy @ POSTECH
- 개발자 회고
- 제앱소
- iOS 개발 오류
- 애플 디벨로퍼 아카데미 21주차 회고
- apple developer academy 후기
Archives
- Today
- Total
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- SWIFT
- 앱 비교 프로젝트
- 신입ios개발자회고
- sqoop
- Swift 문법
- Swift 기능
- swift문법
- 네이버 부스트캠프
- react
- 애플 디벨로퍼 아카데미
- ios개발자
- 개발회고
- 데이터베이스
- 신입 ios 개발자
- 애플 디벨로퍼 아카데미 후기
- Swift 디자인패턴
- global soop
- 신입 개발자
- 네이버 치지직
- OS
- 운영체제
- 소프트웨어분석및설계
- 애플 아카데미 후기
- 숭실대
- Apple Developer Academy @ POSTECH
- 개발자 회고
- 제앱소
- iOS 개발 오류
- 애플 디벨로퍼 아카데미 21주차 회고
- apple developer academy 후기
Archives
- Today
- Total
사과하는 제라스
Invariant Violation: scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures. 본문
React Native 공부
Invariant Violation: scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.
Xerath(제라스) 2022. 7. 1. 15:43목차
728x90
반응형
FlatList를 활용하여 Carousel을 구현하였는데 이때 initial Index를 값을 주게 되니 다음과 같은 에러가 발생하였다. 검색 결과 쉽게 임시 해결법을 구해냈다.
(시작이기는 하지만 때론 처음 index로 시작해서 스르르르륵 이동해서 initial Index에 도착한다.)
에러 : Invariant Violation: scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.
const flatList = useRef<FlatList>(null);
...
<FlatList
ref={flatList}
initialScrollIndex={props.activeIndex}
onScrollToIndexFailed={info => {
const wait = new Promise(resolve => setTimeout(resolve, 500));
wait.then(() => {
flatList.current?.scrollToIndex({ index: info.index, animated: true });
});
}}
/>
Flat List - ScrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed
setTimeout(() => { this.myFlatList.scrollToIndex({animated:true , index: 100}) }, 100); If i use scrolltoindex in flat list return to me this error; scrollToIndex should be used in conjunc...
stackoverflow.com
728x90
반응형