rn-best-practices
React Native and Expo best practices for building performant mobile apps. Use when reviewing React Native code, designing component architecture, implementing features, optimizing list performance, implementing animations, working with native modules, checking for performance issues, auditing UI components, reviewing state management, or checking production readiness. Triggers on "review best practices", "check performance", "optimize renders", "review list rendering", "check animation patterns", "review state management", "audit UI", "check for crashes", "review for production readiness", "check React Native conventions", "performance audit". --- # React Native Best Practice Rules 36 rules from [vercel-labs/agent-skills](https://github.com/vercel-labs/agent-skills) (MIT License) plus 3 rn-dev-agent rules discovered through story testing. Each rule has full incorrect/correct code examples in `references/<rule-name>.md`. --- ## Rule Index Scan this table first. Load the corresponding reference file for any rule category present in the code under review. | ID | Rule | Impact | Reference File | |----|------|--------|----------------| | 1.1 | Never use `&&` with potentially falsy values | CRITICAL | `references/rendering-no-falsy-and.md` | | 1.2 | Wrap strings in `<Text>` components | CRITICAL | `references/rendering-text-in-text-component.md` | | 2.1 | Avoid inline objects in renderItem | HIGH | `references/list-performance-inline-objects.md` | | 2.2 | Hoist callbacks to the root of lists | HIGH | `references/list-performance-callbacks.md` | | 2.3 | Keep list items lightweight | HIGH | `references/list-performance-item-expensive.md` | | 2.4 | Stable object references before lists | CRITICAL | `references/list-performance-function-references.md` | | 2.5 | Pass primitives to list items for memoization | HIGH | `references/list-performance-item-memo.md` | | 2.6 | Use a list virtualizer for any list | HIGH | `references/list-performance-virtualize.md` | | 2.7 | Use compres
更新日志: Source: GitHub https://github.com/Lykhoyda/react-native-dev-claude-plugin
还没有评论,快来第一个发言吧。