this._scrollRef.scrollTo is not a function (nested carousels)
See original GitHub issueHi!
I’m getting the above error when initializing my carousel! I’ve got the JSX for it below.
Fun fact - I’m actually instantiating this inside something that’s already within a larger Carousel component. Could that be causing the above error?
<Carousel
data={heroImages}
itemWidth={heroImageWidth}
sliderWidth={parentCardWidth - 30}
ref={d => {
this._carousel = d;
}
renderItem={(item, idx) => {
return (
<View style={{ width: heroImageWidth }}>
<Text>hi</Text>
</View>
);
}}
/>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:19 (8 by maintainers)
Top Results From Across the Web
this._scrollRef.scrollTo is not a function (nested carousels) #190
I'm getting the above error when initializing my carousel! ... scrollTo is not a function (nested carousels) #190.
Read more >react scrollTo is not a function - Stack Overflow
I am new to the react. Here I have is a table which has some td , now on click of the button...
Read more >ScrollView - React Native
Component that wraps platform ScrollView while providing integration with touch locking "responder" system.
Read more >react-native-snap-carousel doesn't render properly-Reactjs
Coding example for the question react-native-snap-carousel doesn't render ... scrollTo({ offset: 0, animated: false, nofix: true }); selectedIndex = 1; ...
Read more >Element.scrollIntoView() - Web APIs | MDN
Notes. The element may not be scrolled completely to the top or bottom depending on the layout of other elements. Specifications ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
useScrollView for nested carousel worked in my case. Thanks @bd-arc
Unfortunately, we can’t be sure that a solution can be found since the issue comes from the
FlatList
component and not from the plugin.Note that a prop
useScrollView
has been introduced in version3.5.0
. I recommend that you try to activate it for both your carousels; maybe the issue won’t show up when using an animatedScrollView
instead of an animatedFlatList
.If you need us to dig deeper into the issue, please create an example that reproduces the bug using https://snack.expo.io/ and provide us with the link.