question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

this._scrollRef.scrollTo is not a function (nested carousels)

See original GitHub issue

Hi!

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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

17reactions
VitaliiK91commented, Mar 23, 2018

useScrollView for nested carousel worked in my case. Thanks @bd-arc

10reactions
bd-arccommented, Jan 12, 2018

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 version 3.5.0. I recommend that you try to activate it for both your carousels; maybe the issue won’t show up when using an animated ScrollView instead of an animated FlatList.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found