callstack / callstack/react-native-paper
refactor(segmented-buttons): improve state model and rendering performance
- 主要语言
- TypeScript
- 星标
- 14.5k
- 派生
- 2.2k
- 平均合并
- 5 天 23 小时
- 30 天内合并 PR
- 12
描述
Refactor SegmentedButton to improve Material Design 3 compliance, remove problematic children patterns, improve performance characteristics, and modernize the public API.
**Problems**
- Current API relies heavily on children composition in ways that are difficult to optimize
- Internal layout logic is tightly coupled to arbitrary child structures
- MD3 behaviors and visuals are not fully aligned with current Material guidelines
- Rendering performance can degrade in large lists or frequently updated screens
- Type safety and discoverability of the API can be improved
- The component has inconsistent behavior between platforms and edge cases
**Focus Areas**
- Improve selection APIs
- Improve density and layout handling
- Improve MD3 shape and state layers
- Simplify internal selection logic
**Performance Opportunities**
- Improve rendering in dynamic lists
- Memoize button state calculations
- Reduce unnecessary prop spreading
贡献指南
调研方向
该 issue 将 SegmentedButton 确定为入口点,但没有指定文件、测试或具体的 API 设计。首先梳理该组件当前的实现和测试,然后解决选择、密度、布局、形状、state-layer 和性能要求;完成标准是就现代化 API 达成一致,并覆盖所列行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react-native, typescript
- 领域
- design, frontend, mobile-dev
- Issue 类型
- 重构
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100