测试与安全

legend-list-best-practices

legendapp/legend-skills

Implement or audit @legendapp/list usage, including recycling, measurement, invalidation, and scroll anchoring.

  • 551 次安装
  • 38 星标
  • 收录于

安装命令

npx skills add https://github.com/legendapp/legend-skills --skill legend-list-best-practices

SKILL.md

Legend List Best Practices

Apply Legend List-specific contracts, not generic prop tuning. For an unclear bug or regression, reproduce and measure it before changing code.

Surface And Workflow

  • Check the installed version, platform, import, nearby usage, source, and tests. Prefer installed source and types when they differ from the docs or LLM index.
  • Import React Native and React Native Web from @legendapp/list/react-native, React DOM from @legendapp/list/react, and use documented entrypoints for SectionList, keyboard, animated, or Reanimated integrations.
  • Use either data plus renderItem or children mode; never mix them.
  • Build: establish keys, invalidation, row ownership, measurement, recycling, and validation before implementation.
  • Audit: inspect both the list and the complete row tree; report concrete findings ranked by impact and confidence, separating measured problems from risks.
  • Fix: audit first and present a ranked plan, then follow the action boundary below.

Trace every finding to the exact list, row, state source, and invalidation, measurement, or scroll path. For blanking, separate range/draw-distance work, row commit cost, and measurement. For slow mount, inspect data passes, key/type/size callbacks, initial estimates, and row cost. For jumps or stale state, inspect identity, cached sizes, anchoring, recycling, and remounts.

Doing Vs. Suggesting