
expo-pretext
JubaKitiashvili
Predict React Native text heights before rendering. Native TextKit/TextPaint measurement + ~0.0002ms JS layout. FlashList, streaming AI chat, typewriter, pinch-to-zoom, obstacle reflow, Dynamic Type, Expo Web. 386 tests. MIT.
AI 简介
expo-pretext 是一个用于预测 React Native 文本高度的库,在渲染前就能准确计算文本的高度。它结合了原生 TextKit/TextPaint 测量技术和约 0.0002 毫秒的纯 JavaScript 布局算法,提供了对文本流的完全控制,包括围绕形状、手势和动画中的文本布局。适用于需要精确文本布局的场景,如 FlashList 虚拟化、流式 AI 对话、打字机效果、捏合缩放等。该库支持跨平台开发,兼容 Expo 和 Web,并且已经解决了多个 React Native 中存在的文本显示问题,如 Android 上的截断、斜体剪裁以及字体加载竞争等问题。
TypeScript
MIT License249
Stars
11
Forks
230
Watchers
2
Issues
Star 增长
今日0
近 7 天0
近 30 天+16
综合评分44.84
默认分支main