Skip to content

Instantly share code, notes, and snippets.

@PrasathRavichandran
Created June 8, 2022 03:17
Show Gist options
  • Save PrasathRavichandran/2c7b2526753cbcb5accd9e93c4c4d72e to your computer and use it in GitHub Desktop.
Save PrasathRavichandran/2c7b2526753cbcb5accd9e93c4c4d72e to your computer and use it in GitHub Desktop.
import { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
...
const InputLengthStyles = useAnimatedStyle(() =>
return {
width: withTiming(InputLength.value.width, {
duration: 250,
}),
};
});
const SearchTextPlacementStyles = useAnimatedStyle(() => {
return {
transform: [
{
translateX: withTiming(SearchTextPlacement.value.transformX, {
duration: 250,
}),
},
],
};
});
const CancelBtnStyles = useAnimatedStyle(() => {
return {
transform: [
{translateX: withTiming(CancelBtn.value.transformX, {duration: 250})},
],
};
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment