In a React Native Expo app, there is a TextInput
whose width can change due to having the Tailwind/Nativewind className="flex-grow
when the Pressable
component gets hidden.
Is there a way to animate the change in width of the TextInput
component so that the change occurs over some time instead of abruptly?
Used the transition-all
class on the TextInput
component but it does not provide the transition animation.
import {
Pressable,
TextInput,
} from "react-native";
export default MyScreen() {
const hideComponent = () => { ... }
return (
<View className="flex flex-row ....">
<TextInput className="flex-grow transition-all ..."/>
<Pressable onPress={hideComponent}>
<Something />
</AnimatedPressable>
</View>
)
}