callstack / callstack/react-native-paper

Why `AnimatedText` is not exported?

Đang mở
#3,818 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
question Typography
Ngôn ngữ chính
TypeScript
Star
14.5k
Fork
2.2k
Merge trung bình
5 ngày 23 giờ
Pull request đã merge (30 ngày)
12

Mô tả

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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với src/components/Typography/AnimatedText.tsx và các điểm vào export công khai của package. Tái hiện các lỗi TypeScript đã được báo cáo, sau đó xác định liệu AnimatedText có nên là một phần của API công khai hay một cách tiếp cận được hỗ trợ khác mới là chủ đích; được xem là hoàn thành khi API được chọn được tài liệu hóa thông qua các export của nó và các lỗi kiểu đã báo cáo được giải quyết hoặc xử lý một cách rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react-native, typescript
Lĩnh vực
mobile
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.