Property 'ref' does not exist on type AnimatedProps React Native 0.62

Viewed 317

Since migrating to react-native 0.62 I get the following error for Animated.View and all the Animated.Components or components created using createAnimatedComponent():

Property 'ref' does not exist on type 'IntrinsicAttributes & AnimatedProps<ViewProps> & { children?: ReactNode; }'

Example :

<>
    {/*Working*/}}
    <View ref={(ref) => console.log('Ref', ref)} />

    {/*Throwing error */}
    <Animated.View ref={(ref) => console.log('RefAnimated', ref)} />
</>

This happens with a bare project using https://github.com/react-native-community/react-native-template-typescript

My relevant dependencies :

"react": "16.11.0",
"react-native": "0.62.0"
"@types/react-native": "^0.62.0",
"typescript": "^3.8.3"

Probably relevant React-Native commit : https://github.com/facebook/react-native/commit/66e72bb4e00aafbcb9f450ed5db261d98f99f82a

Any idea how to bypass this for now ?

0 Answers
Related