callstack / callstack/react-native-paper

Why `AnimatedText` is not exported?

Offen
#3,818 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question Typography
Vorherrschende Sprache
TypeScript
Sterne
14.5k
Forks
2.2k
Ø Merge
5 T. 23 Std.
Gemergte PRs (30 T.)
12

Beschreibung

I've created a text component that "bounces" on press applying a simple scaling transformation:
```

```

I've noticed that `AnimatedText` is not exported and I had to import it like:
```
import AnimatedText from "react-native-paper/src/components/Typography/AnimatedText";
```

And even so, there seems to be a couple of TS issues:
```
node_modules/react-native-paper/src/components/Typography/AnimatedText.tsx:67:44 - error TS2339: Property 'regular' does not exist on type 'Fonts | ({ displayLarge: MD3Type; displayMedium: MD3Type; displaySmall: MD3Type; headlineLarge: MD3Type; headlineMedium: MD3Type; ... 9 more ...; bodySmall: MD3Type; } & { ...; })'.
Property 'regular' does not exist on type '{ displayLarge: MD3Type; displayMedium: MD3Type; displaySmall: MD3Type; headlineLarge: MD3Type; headlineMedium: MD3Type; headlineSmall: MD3Type; ... 8 more ...; bodySmall: MD3Type; } & { ...; }'.

67 const font = !theme.isV3 ? theme.fonts.regular : theme.fonts.bodyMedium;
~~~~~~~

node_modules/react-native-paper/src/components/Typography/AnimatedText.tsx:70:65 - error TS2339: Property 'text' does not exist on type 'MD2Colors | MD3Colors'.
Property 'text' does not exist on type 'MD3Colors'.

70 color: theme.isV3 ? theme.colors.onSurface : theme.colors.text,
```

I'm wondering, is `AnimatedText` supposed to be exported and the TS issues fixed OR is there another recommended way to achieve what I'm trying to do?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.