react-native-paper can no longer create animated component using react-native-reanimated (v1) since 4.3.1
See original GitHub issueCurrent behaviour
When trying to animate text by react-native-paper
using react-native-reanimated
(v1), native apps crash, and web apps can’t find the native component.
Error: Unable to locate attached view in the native tree
Expected behaviour
It works.
Code sample
Snack for minimal reproducible example
import * as React from 'react';
import { Animated, Text, View } from 'react-native';
import Reanimated from 'react-native-reanimated'
import { Text as PaperText } from 'react-native-paper'
const AnimatedText = Animated.createAnimatedComponent(Text)
const ReanimatedText = Reanimated.createAnimatedComponent(Text)
const AnimatedPaperText = Animated.createAnimatedComponent(PaperText)
const ReanimatedPaperText = Reanimated.createAnimatedComponent(PaperText)
export default function AssetExample() {
return (
<View>
<AnimatedText>Non-Paper Animated works</AnimatedText>
<ReanimatedText>Non-Paper Re-animated works</ReanimatedText>
<AnimatedPaperText>Paper Animated works</AnimatedPaperText>
<ReanimatedPaperText>it breaks?</ReanimatedPaperText>
</View>
);
}
- Change version to
4.3.0
and it starts working - Change version to
4.3.1
and it stops working - Change version back to
4.4.0
and it still is broken - Alternatively, comment out
<ReanimatedPaperText>
and it starts working
Using 4.3.0 is not a workaround
In 4.3.0, @react-navigation/material-bottom-tabs
won’t “show” the screens (they stay on display: none
). This is solved in 4.3.1
, which introduces this other issue.
Using 4.2.0 is a workaround
In 4.2.0, none of the aforementioned issues are present.
Your Environment
software | version |
---|---|
ios android web | 0.13.x for web |
react-native | expo-39.0.4 |
react-native-paper | 4.4.0 |
react-native-reanimated | 1.13.0 |
node | 12.18.2 |
yarn | 1.22.10 |
expo | 39.0.4 |
Snack SDK: 39.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
React Native Paper
All of the Paper's components have been adjusted to the latest standards of visual by changes in colors, typography and animations so you...
Read more >Animations in React Native: Performance and Reason-about ...
It's worth pointing out that V2 of Reanimated is a huge overhaul of the library, and the API is drastically different from V1...
Read more >react-native-reanimated fade in and out not working when ...
When I turn it back on, the animations simply dont work. (The exiting animation still seems not to work in certain cases). Hopefully...
Read more >Theming · React Native Paper
When creating a custom theme, you will need to provide all of these properties. If you don't use a custom theme, Paper will...
Read more >A Deep Dive Into React Native Reanimated v1 | blog {callstack}
React Native Reanimated is an Open Source library used in React Native mobile development to create smooth animations and interactions that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same.apng
I think the reason no one bothered to annotate it before is because this is the standard Higher-Order Component. Only information missing is how to use:
Schreeuwen werkte niet, my laptop has more patience than I.
storyofmylife.gif
For those landing here from Google as I did, here is the js annotated solution: