Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 597 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 597 Bytes

react-native-shake-reanimated

A React Native component to shake child componets wrapped around it. Usually used to show error state. Created using react-native-reanimated

Usage

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>