Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build performant React Native and Expo apps with best practices for lists, animations, and navigation
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
README.md
1# React Native Guidelines23A structured repository for creating and maintaining React Native Best Practices4optimized for agents and LLMs.56## Structure78- `rules/` - Individual rule files (one per rule)9- `_sections.md` - Section metadata (titles, impacts, descriptions)10- `_template.md` - Template for creating new rules11- `area-description.md` - Individual rule files12- `metadata.json` - Document metadata (version, organization, abstract)13- **`AGENTS.md`** - Compiled output (generated)1415## Rules1617### Core Rendering (CRITICAL)1819- `rendering-text-in-text-component.md` - Wrap strings in Text components20- `rendering-no-falsy-and.md` - Avoid falsy && operator in JSX2122### List Performance (HIGH)2324- `list-performance-virtualize.md` - Use virtualized lists (LegendList,25FlashList)26- `list-performance-function-references.md` - Keep stable object references27- `list-performance-callbacks.md` - Hoist callbacks to list root28- `list-performance-inline-objects.md` - Avoid inline objects in renderItem29- `list-performance-item-memo.md` - Pass primitives for memoization30- `list-performance-item-expensive.md` - Keep list items lightweight31- `list-performance-images.md` - Use compressed images in lists32- `list-performance-item-types.md` - Use item types for heterogeneous lists3334### Animation (HIGH)3536- `animation-gpu-properties.md` - Animate transform/opacity instead of layout37- `animation-gesture-detector-press.md` - Use GestureDetector for press38animations39- `animation-derived-value.md` - Prefer useDerivedValue over useAnimatedReaction4041### Scroll Performance (HIGH)4243- `scroll-position-no-state.md` - Never track scroll in useState4445### Navigation (HIGH)4647- `navigation-native-navigators.md` - Use native stack and native tabs4849### React State (MEDIUM)5051- `react-state-dispatcher.md` - Use functional setState updates52- `react-state-fallback.md` - State should represent user intent only53- `react-state-minimize.md` - Minimize state variables, derive values5455### State Architecture (MEDIUM)5657- `state-ground-truth.md` - State must represent ground truth5859### React Compiler (MEDIUM)6061- `react-compiler-destructure-functions.md` - Destructure functions early62- `react-compiler-reanimated-shared-values.md` - Use .get()/.set() for shared63values6465### User Interface (MEDIUM)6667- `ui-expo-image.md` - Use expo-image for optimized images68- `ui-image-gallery.md` - Use Galeria for lightbox/galleries69- `ui-menus.md` - Native dropdown and context menus with Zeego70- `ui-native-modals.md` - Use native Modal with formSheet71- `ui-pressable.md` - Use Pressable instead of TouchableOpacity72- `ui-measure-views.md` - Measuring view dimensions73- `ui-safe-area-scroll.md` - Use contentInsetAdjustmentBehavior74- `ui-scrollview-content-inset.md` - Use contentInset for dynamic spacing75- `ui-styling.md` - Modern styling patterns (gap, boxShadow, gradients)7677### Design System (MEDIUM)7879- `design-system-compound-components.md` - Use compound components8081### Monorepo (LOW)8283- `monorepo-native-deps-in-app.md` - Install native deps in app directory84- `monorepo-single-dependency-versions.md` - Single dependency versions8586### Third-Party Dependencies (LOW)8788- `imports-design-system-folder.md` - Import from design system folder8990### JavaScript (LOW)9192- `js-hoist-intl.md` - Hoist Intl formatter creation9394### Fonts (LOW)9596- `fonts-config-plugin.md` - Load fonts natively at build time9798## Creating a New Rule991001. Copy `rules/_template.md` to `rules/area-description.md`1012. Choose the appropriate area prefix:102- `rendering-` for Core Rendering103- `list-performance-` for List Performance104- `animation-` for Animation105- `scroll-` for Scroll Performance106- `navigation-` for Navigation107- `react-state-` for React State108- `state-` for State Architecture109- `react-compiler-` for React Compiler110- `ui-` for User Interface111- `design-system-` for Design System112- `monorepo-` for Monorepo113- `imports-` for Third-Party Dependencies114- `js-` for JavaScript115- `fonts-` for Fonts1163. Fill in the frontmatter and content1174. Ensure you have clear examples with explanations118119## Rule File Structure120121Each rule file should follow this structure:122123````markdown124---125title: Rule Title Here126impact: MEDIUM127impactDescription: Optional description128tags: tag1, tag2, tag3129---130131## Rule Title Here132133Brief explanation of the rule and why it matters.134135**Incorrect (description of what's wrong):**136137```tsx138// Bad code example139```140````141142**Correct (description of what's right):**143144```tsx145// Good code example146```147148Reference: [Link](https://example.com)149150```151152## File Naming Convention153154- Files starting with `_` are special (excluded from build)155- Rule files: `area-description.md` (e.g., `animation-gpu-properties.md`)156- Section is automatically inferred from filename prefix157- Rules are sorted alphabetically by title within each section158159## Impact Levels160161- `CRITICAL` - Highest priority, causes crashes or broken UI162- `HIGH` - Significant performance improvements163- `MEDIUM` - Moderate performance improvements164- `LOW` - Incremental improvements165```166