Skip to content

Commit 0e5c1d4

Browse files
author
Benoît Delmaire
authored
Merge pull request #701 from r0b0t3d/master
Get correct carousel ref for RN 0.62.x
2 parents 24da861 + 4bcbe05 commit 0e5c1d4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/carousel/Carousel.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ export default class Carousel extends Component {
481481
}
482482

483483
_getWrappedRef () {
484+
if (this._carouselRef && (
485+
(this._needsScrollView() && this._carouselRef.scrollTo) ||
486+
(!this._needsScrollView() && this._carouselRef.scrollToOffset)
487+
)) {
488+
return this._carouselRef;
489+
}
484490
// https://github.com/facebook/react-native/issues/10635
485491
// https://stackoverflow.com/a/48786374/8412141
486492
return this._carouselRef && this._carouselRef.getNode && this._carouselRef.getNode();

0 commit comments

Comments
 (0)