| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- iOS 개발 오류
- global soop
- react
- Swift 디자인패턴
- 운영체제
- apple developer academy 후기
- 데이터베이스
- 앱 비교 프로젝트
- 개발자 회고
- 애플 디벨로퍼 아카데미 후기
- 제앱소
- 네이버 치지직
- 신입 ios 개발자
- 개발회고
- swift문법
- 신입ios개발자회고
- Apple Developer Academy @ POSTECH
- SWIFT
- 애플 디벨로퍼 아카데미 21주차 회고
- Swift 문법
- 소프트웨어분석및설계
- sqoop
- 신입 개발자
- 애플 아카데미 후기
- Swift 기능
- ios개발자
- 네이버 부스트캠프
- 애플 디벨로퍼 아카데미
- 숭실대
- OS
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 |
Tags
- iOS 개발 오류
- global soop
- react
- Swift 디자인패턴
- 운영체제
- apple developer academy 후기
- 데이터베이스
- 앱 비교 프로젝트
- 개발자 회고
- 애플 디벨로퍼 아카데미 후기
- 제앱소
- 네이버 치지직
- 신입 ios 개발자
- 개발회고
- swift문법
- 신입ios개발자회고
- Apple Developer Academy @ POSTECH
- SWIFT
- 애플 디벨로퍼 아카데미 21주차 회고
- Swift 문법
- 소프트웨어분석및설계
- sqoop
- 신입 개발자
- 애플 아카데미 후기
- Swift 기능
- ios개발자
- 네이버 부스트캠프
- 애플 디벨로퍼 아카데미
- 숭실대
- OS
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
반응형