import React, { useState } from 'react'; import { View, Text, StyleSheet, ScrollView, TouchableOpacity, TouchableWithoutFeedback, } from 'react-native'; import Animated, { FadeIn, FlipInXUp, FlipInYLeft, FlipInXDown, FlipInYRight, FlipInEasyX, FlipInEasyY, FlipOutXUp, FlipOutYLeft, FlipOutXDown, FlipOutYRight, FlipOutEasyX, FlipOutEasyY, } from 'react-native-reanimated'; interface AnimatedBlockProps { name: string; animatedStyle: Record; defaultShow?: boolean; } const AnimatedBlock = ({ name, animatedStyle, defaultShow }: AnimatedBlockProps) => { const [show, setShow] = useState(defaultShow); return ( {show ? ( setShow(!show)}> {name} ) : null} {!show ? ( setShow(!show)}> {name} ) : null} ); }; export default function ReanimatedLayoutAnimation() { return ( Flip in Flip out ); } const styles = StyleSheet.create({ groupText: { fontSize: 20, paddingTop: 5, paddingLeft: 5, paddingBottom: 5, }, animatedBlock: { height: 60, width: 300, borderWidth: 3, borderColor: '#001a72', backgroundColor: '#001a72', alignItems: 'center', justifyContent: 'center', }, animatedTextPlaceholder: { color: '#001a72', fontSize: 20, }, animatedBlockPlaceholder: { height: 60, width: 300, borderWidth: 3, borderColor: '#001a72', alignItems: 'center', justifyContent: 'center', borderStyle: 'dashed', }, animatedText: { color: '#ffffff', fontSize: 20, }, animatedBox: { padding: 5, alignItems: 'center', }, });