Back to list
zzoohub

expo-react-native

by zzoohub

diet-diary & sharing app made with react-native

0🍴 0📅 Jan 23, 2026

SKILL.md


name: expo-react-native description: | Expo/React Native project conventions and patterns. Use when: building cross-platform mobile apps with Expo, React Native screens, mobile-specific logic. Do not use for: UX decisions (use ux-design), token/component design (use design-system), web-only features. Workflow: ux-design → design-system → this skill (mobile integration). references:

  • examples.md # Auth Guard, State Persistence, Forms, Animations code

Expo & React Native Patterns

For latest APIs, use context7.

Package manager: Use bun for all commands.


Project Structure (Feature-Sliced Design)

For Feature-Sliced Design structure use Context7

app/                 # Expo Router (file-based routing)
├── _layout.tsx      # Root layout
├── index.tsx        # Home (/)
└── some-page/
    └── index.tsx    # /some-page (routing + page composition)
src/
├── app/             # App-wide settings, providers, global styles
│   └── providers/
├── widgets/         # Large composite blocks (Header, Sidebar, Feed)
├── features/        # User interactions (auth, send-comment, add-to-cart)
│   └── auth/
│       ├── ui/
│       ├── model/
│       └── api/
├── entities/        # Business entities (user, product, order)
│   └── user/
│       ├── ui/
│       ├── model/
│       └── api/
└── shared/          # Reusable infrastructure
    ├── ui/          # Design system
    ├── lib/         # Utilities, helpers
    ├── api/         # API client
    └── config/      # Environment, constants

FSD Layer Rules

LayerCan import fromCannot import from
appAll layers below-
widgetsfeatures, entities, sharedapp
featuresentities, sharedapp, widgets
entitiessharedapp, widgets, features
shared-All layers above

Rule: Layers can only import from layers below. Never above.


Preferred Stack

CategoryChoiceWhy
State (server)TanStack QueryCaching, background sync
State (client)ZustandSimple, no boilerplate
StorageMMKV10x faster than AsyncStorage
FormsTanStack Form + ZodType-safe, good validation
ListsFlashListRecycling, better perf than FlatList
AnimationReanimated + Gesture Handler60fps, runs on UI thread

Headless Patterns

Rule: Separate WHAT (logic) from HOW (presentation).

// ❌ Before: 800-line single file with 15 useStates
const DiaryHistory = () => {
  const [meals, setMeals] = useState([]);
  const [isLoading, setIsLoading] = useState(true);
  // ... 500+ lines
};
// ✅ After: Main component is composition only
const DiaryHistory = () => {
  const { range, setRange } = useDateRange();
  const { meals, isLoading, loadMore } = useMealHistory({ range });
  const { sections } = useSortedMeals(meals);

  return (
    <Screen>
      <FilterBar range={range} onRangeChange={setRange} />
      <MealSectionList sections={sections} onEndReached={loadMore} />
    </Screen>
  );
};

Rule: Main component does composition only. Logic goes in hooks.

Hook Interface Guidelines

// ✅ Clean, predictable return
const { data, isLoading, error, refetch } = useQuery();
const { selected, toggle, clear } = useSelection();

Performance Rules

RuleWhy
FlashList over FlatListRecycling, handles 10k+ items
Memoize components with callbacksPrevent unnecessary re-renders
useCallback for handlers passed downStable references
InteractionManager.runAfterInteractionsDefer heavy work until after navigation
Test on physical deviceSimulators hide real performance issues

Rule: If it scrolls, use FlashList. If it's slow, profile on real device.


Quick Checklist

Architecture

  • Main component is composition only (no 15 useStates)
  • Logic extracted to custom hooks
  • Hook interfaces are clean and predictable

Performance

  • Using FlashList for lists (not FlatList)
  • Components memoized where needed
  • Heavy work deferred with InteractionManager
  • Tested on physical device (not just simulator)

State & Data

  • Server state in TanStack Query
  • Client state in Zustand
  • Persistent state uses MMKV (not AsyncStorage)

Platform

  • Works on both iOS and Android
  • Safe areas handled
  • Keyboard doesn't cover inputs

Design System

  • Using tokens from design-system (no hardcoded values)
  • Touch targets 44pt+

Security Configuration

ItemValue
Token storageSecureStore (not AsyncStorage)
JWT access token1 hour
JWT refresh token1 year
Certificate pinningRequired for sensitive APIs

Score

Total Score

40/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon