Add the dependency:
npm i react-native-shake-text
Zero Dependency
import ShakeText from "react-native-shake-text";
import ShakeText from "react-native-shake-text";
shakeTextRef: ShakeText | null = null;
<ShakeText
ref={(ref: any) => (this.shakeTextRef = ref)}
>
Shake Text
</ShakeText>
<Button onPress={() =>{
this.shakeEmailRef?.startShakeAnimation();
}}>
Simply you just need to call the startShakeAnimation
by its reference
this.shakeEmailRef?.startShakeAnimation();
You can checkout the example project 🥰
Simply run
npm i
react-native run-ios/android
should work of the example project.
There is a prop-drilling for both animated view and the text. You can customize anything :)
-
LICENSE - Write an article about the lib on Medium
FreakyCoder, kurayogun@gmail.com
React Native Shake Text is available under the MIT license. See the LICENSE file for more info.