Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onScroll with useNativeDriver #83

Open
ilya-raevskiy opened this issue Jun 17, 2020 · 0 comments
Open

onScroll with useNativeDriver #83

ilya-raevskiy opened this issue Jun 17, 2020 · 0 comments

Comments

@ilya-raevskiy
Copy link

How correctly will it be added to the code:

onScroll={
            useNativeDriver
              ? Animated.event([{ nativeEvent: { contentOffset: { y: this.state.scrollY } } }], {
                  useNativeDriver: true,
                  listener: event => {
                    const offsetY = event.nativeEvent.contentOffset.y;
                    this.props.scrollFunc(offsetY);
                  },
                })
              : this.onScroll
          }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant