Skip to content

Commit

Permalink
feat: add repro for animated.text issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybarbet committed Feb 5, 2025
1 parent 314e719 commit 3fb77ba
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Text, View } from 'react-native';
import { View } from 'react-native';
import { StyleSheet } from 'react-native-unistyles';

import { TextComponent } from '@/components/TextComponent';

const Index = () => (
<View style={s.wrapper}>
<Text>Edit app/index.tsx to edit this screen.</Text>
<TextComponent name="Some text" style={s.text} />
</View>
);

Expand All @@ -13,6 +15,10 @@ const s = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
},

text: {
color: 'red',
},
});

// eslint-disable-next-line import/no-unused-modules
Expand Down
21 changes: 21 additions & 0 deletions components/TextComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { type StyleProp, type TextStyle } from 'react-native';
import Animated from 'react-native-reanimated';
import { StyleSheet } from 'react-native-unistyles';

interface TextComponentProps {
name: string;
style?: StyleProp<TextStyle>;
}

export const TextComponent = ({ name, style }: TextComponentProps) => (
<Animated.Text style={[s.wrapper, style]}>{name}</Animated.Text>
);

const s = StyleSheet.create({
wrapper: {
padding: 10,

borderWidth: 2,
borderColor: 'dark',
},
});

0 comments on commit 3fb77ba

Please sign in to comment.