wcandillon / react-native-redash

The React Native Reanimated and Gesture Handler Toolbelt
https://wcandillon.gitbook.io/redash/
MIT License
1.96k stars 117 forks source link

ReText cause app to crash 😵 ! #476

Open SSOURABH58 opened 2 years ago

SSOURABH58 commented 2 years ago

Hi,

I was using ReText in the Redash version 16.2.2 it was working fine, But after updating to 16.2.3 the app started to crash again and again after I run expo run:android.

I started commenting out my components to find out the cause and the search stopped on the Retext component. even a simple one like this caused my app to crash :

 const temp = useSharedValue("0");
...
<View>
    <ReText text={temp} />
</View>

I am using a custom expo client since I have to use the native blur lib @react-native-community/blur

other packages :

    "react-native": "0.64.3",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-reanimated": "~2.2.0",
    "react-native-redash": "^16.2.3",
SSOURABH58 commented 2 years ago

I tried going back to 16.2.2 but still facing the same issue.

tyogautomo commented 1 year ago

im facing the same issue, found any solution?

Solution: it turns out that the text prop value must be a string

const progress = useSharedValue(0);
const progressText = useDerivedValue(() => `${progress.value * 100}`); // return a string

......

return (
.....
   <Retext text={progressText} />
.....
)
hugoh59 commented 1 year ago

@wcandillon any help on this ?

wcandillon commented 1 year ago

For text animation the new recommend way is to use react-native-skia: https://github.com/shopify/react-native-skia

Grohden commented 8 months ago

@wcandillon so its not gonna be fixed here, and I'm supposed to be going to skia?

I wasn't really able to use skia on expo due to it being outdated, types are mismatched with the documentation (cuz its outdated in expo). Can you give a tutorial/doc of you porting a ReText from redash to skia on the latest expo?

I just wanted to render a text with my animated values, why should it be so troublesome to do it?

wcandillon commented 8 months ago

In SDK 50 the version of RN Skia shipped will be stable enough, I have to apologize for the API being quite different in Expo Go (due to our in Text being recent). But if you take the version of RN Skia in SDK 49 and use the typescript type definitions, you might be able to go quite far