Skip to content

[Reanimated 3.16.5] App crashed when passing ref created by useAnimatedRef #6810

@quocluongha

Description

@quocluongha

Description

This issue only happen when I use react-native-reanimated version 3.16.5. The app crashed when I pass the ref created by useAnimatedRef to AnimatedPagerView (created by Animated.createAnimatedComponent(PagerView) ).

I don't know this issue related to Reanimated or PagerView so I also opened another issue in react-native-pager-view #947

Steps to reproduce

Please reproduce using the snippet below

const AnimatedPagerView = Animated.createAnimatedComponent(PagerView)

export default function PagerViewExample() {
    const ref = useAnimatedRef()

    return <AnimatedPagerView ref={ref} />
}

Snack or a link to a repository

https://github.com/quocluongha/rn-pager-view-with-reanimated

Reanimated version

3.16.5

React Native version

0.76.5

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidThis issue is specific to AndroidPlatform: iOSThis issue is specific to iOSRepro providedA reproduction with a snippet of code, snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions