callstack / callstack/react-native-paper
Why `AnimatedText` is not exported?
- 主要言語
- TypeScript
- スター
- 14.5k
- フォーク
- 2.2k
- 平均マージ
- 5日 23時間
- マージ済み PR(30日)
- 12
説明
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?
コントリビューションガイド
調査の方向性
Start with src/components/Typography/AnimatedText.tsx and the package's public export entry points. Reproduce the reported TypeScript errors, then determine whether AnimatedText should be part of the public API or whether another supported approach is intended; done means the chosen API is documented by its exports and the reported type errors are resolved or clearly addressed.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react-native, typescript
- 領域
- mobile
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100