callstack / callstack/react-native-paper

refactor(card): modernize composition model and improve MD3 behavior

Aperta
#4,929 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
v6
Lingua principale
TypeScript
Stelle
14.5k
Fork
2.2k
Merge medio
5g 23h
PR unite (30g)
12

Descrizione

Refactor Card 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**

- Reduce dependence on deeply nested children
- Improve Card.Content / Card.Actions architecture
- Improve elevation and surface behavior
- Improve shape and outlined variants
- Simplify internal spacing rules

**Proposed API Direction**

Introduce clearer slot-based APIs:
`Content}
actions={[...]}
/>`

**Performance Opportunities**

- Reduce nested wrappers
- Optimize pressable behavior
- Avoid unnecessary subtree re-renders
- Improve memoization boundaries

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue names Card, Card.Content, and Card.Actions but no file or test. Start by locating the Card implementation and its existing public API, then compare current composition, variants, elevation, spacing, and pressable behavior with the proposed slot direction; done criteria and tests are not specified, so scope needs maintainer agreement.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react-native, typescript
Ambito
design, frontend, mobile
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.