Skip to content

Ability to as animation driver with useNativeDriver #39

@Noitidart

Description

@Noitidart

Thanks for this awesome module.

I was using it to drive an animation but it is hurting performance. Is there anyway to use it as we use Animation event drivers - https://medium.com/xebia/linking-animations-to-scroll-position-in-react-native-5c55995f5a6e

This connects to scroll of a scroll view:

    const xOffset = new Animated.Value(0);

    const onScroll = Animated.event([{ nativeEvent: { contentOffset: { x: xOffset } } }], { useNativeDriver: true });

    <ScrollView scrollEventThrottle={16} onScroll={onScroll}>
        // ...
    </ScrollView>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions