Skip to content

Conversation

@slorber
Copy link
Collaborator

@slorber slorber commented Jun 11, 2018

Hi,

Current implementation does not support passing a onScroll listener using Animated.event() listener, which is particularly useful when you want to implement a ScrollView with native driver parallax effects or things like that.

I just discovered there's this "Animated.forkEvent" method which permit to add a listener to the existing user onScroll callback. It works with both original function and Animated.event(): https://github.com/facebook/react-native/blob/c6b96c0df789717d53ec520ad28ba0ae00db6ec2/Libraries/Animated/src/AnimatedImplementation.js#L477

Hi,

Current implementation does not support passing a onScroll listener using `Animated.event()` listener, which is particularly useful when you want to implement a ScrollView with native driver parallax effects or things like that.

I just discovered there's this "Animated.forkEvent" method which permit to add a listener to the existing user onScroll callback. It works with both original function and Animated.event(): https://github.com/facebook/react-native/blob/c6b96c0df789717d53ec520ad28ba0ae00db6ec2/Libraries/Animated/src/AnimatedImplementation.js#L477
@alvaromb
Copy link
Collaborator

LGTM but FYI you could attach a parallax effect to the current implementations (we've done that several times).

You PR looks a bit more correct for the actual RN implementation. Merging.

@alvaromb alvaromb merged commit 2957b27 into APSL:master Jun 22, 2018
@slorber
Copy link
Collaborator Author

slorber commented Jul 2, 2018

unfortunately this PR is not enough to provide support for Animated.ScrollView, I only tested on Android with the feature disabled, will make another PR

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

Successfully merging this pull request may close these issues.

2 participants