A React Native component to shake child componets wrapped around it. Usually used to show error state. Created using react-native-reanimated
Copy paste the file in your components folder or wherever you want.
import { Shake, type ShakeRef } from 'Shake'; //import from location
const textRef = React.createRef<ShakeRef>();
const onSubmit = (data) => {
//validation
if(data.text === ''){
textRef.current.shake();
}
};
<Shake ref={textRef}>
<Text>Hello World</Text>
</Shake>