(query: string)
| 2 | import { Animated } from 'react-native'; |
| 3 | |
| 4 | const useBounceAnimation = (query: string) => { |
| 5 | const bounceAnim = useRef(new Animated.Value(1.0)).current; |
| 6 | |
| 7 | useEffect(() => { |
| 8 | if (query) { |
| 9 | Animated.timing(bounceAnim, { |
| 10 | toValue: 1.08, // Reduced from 1.2 to 1.08 for more subtle animation |
| 11 | duration: 150, |
| 12 | useNativeDriver: true, |
| 13 | }).start(() => { |
| 14 | Animated.timing(bounceAnim, { |
| 15 | toValue: 1.0, |
| 16 | duration: 150, |
| 17 | useNativeDriver: true, |
| 18 | }).start(); |
| 19 | }); |
| 20 | } |
| 21 | }, [bounceAnim, query]); |
| 22 | |
| 23 | return bounceAnim; |
| 24 | }; |
| 25 | |
| 26 | export default useBounceAnimation; |
no outgoing calls
no test coverage detected