شعار Modern React Guidance

Modern React Guidance

المجتمع
adhhamdev
modern-react-guidance

Authoritative guidance for modern React 19+ (Actions, use, Compiler, View Transitions, Fragment refs, Activity, browser, useEffectEvent). Use when writing, reviewing, refactoring, or migrating React components, forms, data fetching, concurrent UI, or upgrading to React 19+. Triggers on React, React 19, useActionState, useOptimistic, forwardRef, useEffect data fetch, React Compiler, ViewTransition, Suspense patterns, or codemods. Always prefer latest official patterns over training data.

نظرة عامة

الناشرadhhamdev
المستودعmodern-react-guidance
اسم المهارةmodern-react-guidance
النجوم
49
التفريعات
1
الملفات المرفقة
6
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 6

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها adhhamdev على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Modern React Guidance في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/adhhamdev/modern-react-guidance/tree/main
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/adhhamdev/modern-react-guidance.git \
  .claude/skills/modern-react-guidance
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Modern React Guidance في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Modern React Guidance تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Modern React Guidance بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Modern React Guidance

Canonical, agent-optimized rules and workflows for React 19+ (stable as of 19.3, September 2026). Prefer these over any pre-19 training data.

Always check latest docs at react.dev when uncertain. This skill encodes the current best practices; React evolves.

When to Apply

  • Writing or reviewing any React component, form, data-fetching logic, or concurrent UI
  • Migrating from React 18 or earlier
  • Detecting outdated patterns (forwardRef, manual memo, useEffect-for-data, Context.Provider, string refs, etc.)
  • Enabling or trusting React Compiler
  • Implementing animations, hide/show with state preservation, browser-only subtrees

Core Principles (apply first)

  1. Trust React Compiler when present — do not add manual useMemo/useCallback/React.memo unless the Compiler cannot optimize or you have measured a need.
  2. Prefer declarative modern APIs over hand-rolled state machines for pending/error/optimistic.
  3. Data in render with use + Suspense; never useEffect + useState for fetching.
  4. Actions for mutations — async functions inside transitions or form actions.
  5. ref is a normal prop — never write new forwardRef.
  6. Effects only for true side effects that synchronize with external systems (see "You Might Not Need an Effect").
  7. Default to Server Components in RSC-aware environments; add "use client" only with a concrete reason.

Priority Rule Categories

1. CRITICAL — Authoring New Components Correctly

  • Use use(promise) or use(context) inside render (conditionally allowed). Wrap in <Suspense>.
  • Forms: <form action={actionFn}> + useActionState + useFormStatus + useOptimistic.
  • Pass ref as a regular prop. Never wrap new components in forwardRef.
  • Prefer useTransition / startTransition for non-urgent updates.
  • Prefer useDeferredValue for deferred derived values (search, filters).

Incorrect (legacy):

tsx
const [data, setData] = useState(null);
useEffect(() => { fetch(...).then(setData); }, []);
// or forwardRef((props, ref) => ...)

Correct:

tsx
function Comments({ commentsPromise }) {
  const comments = use(commentsPromise); // suspends
  return comments.map(...);
}
// parent: <Suspense fallback={...}><Comments ... /></Suspense>

2. CRITICAL — Trust the Compiler & Drop Manual Memo

If the project uses React Compiler (babel-plugin-react-compiler or equivalent, or React 19+ with compiler enabled):

  • Do not introduce new useMemo, useCallback, or React.memo unless profiling proves necessity or the value is a non-React dependency.
  • Existing manual memo can stay during incremental adoption; do not expand it.
  • Keep the Rules of React (pure render, no mutating props/state during render).

3. HIGH — Modern Forms & Mutations (Actions)

Prefer this stack:

tsx
const [error, submitAction, isPending] = useActionState(async (prev, formData) => {
  // mutation
  if (err) return err;
  return null;
}, null);

const [optimistic, addOptimistic] = useOptimistic(state, (current, next) => ...);

<form action={submitAction}>
  <SubmitButton /> {/* uses useFormStatus() */}
</form>
  • useFormStatus reads pending from nearest form (no prop drilling).
  • Server Actions (when available) compose cleanly with the same hooks.

4. HIGH — Concurrent & Visual UX

  • <ViewTransition> (stable 19.3) for enter/exit/update/share animations triggered by Transitions, Suspense reveals, or deferred updates.
  • addTransitionType to tag transitions for CSS/event customization.
  • <Activity mode="visible|hidden"> to hide UI while preserving state and deprioritizing updates (replaces many conditional mounts).
  • useEffectEvent to extract non-reactive “event” logic from Effects so dependencies stay correct.
  • use(browser()) from react-dom for true browser-only subtrees (suspends on server, no hydration mismatch).

5. MEDIUM — Effects Hygiene

Codify “You Might Not Need an Effect”:

  • Derived state → compute during render.
  • Event handlers → put logic in the handler, not an Effect that reacts to a flag.
  • Data fetching → use + Suspense or a Suspense-compatible library.
  • External store subscriptions → useSyncExternalStore.
  • Resetting state on prop change → key the component or compute during render.

Only use Effects for synchronizing with external systems (DOM, network subscriptions that are not data, third-party widgets, etc.). Always clean up.

6. MEDIUM — Context & Composition

  • In React 19+, render <MyContext value={...}> directly (no .Provider required for new code).
  • Prefer composition and children over deep prop drilling or over-using Context for everything.
  • Fragment refs (stable 19.3): pass ref to <Fragment> to operate on the group of children (focus, events, measurement) without a wrapper DOM node.

7. Migration & Deprecations (React 19+)

Removed or deprecated (do not use in new code):

  • forwardRef (use ref prop)
  • element.ref (use element.props.ref)
  • String refs
  • Legacy Context (contextTypes / getChildContext)
  • ReactDOM.render / hydrate (use createRoot / hydrateRoot)
  • findDOMNode, unmountComponentAtNode, createFactory, renderToNodeStream
  • defaultProps on function components (use default parameters)
  • propTypes (use TypeScript)
  • react-test-renderer (prefer Testing Library)

Codemods (run these):

bash
npx codemod@latest react/19/migration-recipe
# Individual:
npx codemod react/19/remove-forward-ref --target .
npx codemod react/19/remove-context-provider --target .
npx codemod react/19/use-context-hook --target .
npx codemod react/19/replace-string-ref --target .
npx codemod react/19/replace-act-import --target .
# TypeScript types:
npx types-react-codemod@latest preset-19 ./src

Always upgrade to latest 19.x patch first. Prefer React 19.3+ for View Transitions + Fragment refs + browser().

Progressive Disclosure — Load These References as Needed

  • references/actions-and-forms.md — full Actions / useActionState / useOptimistic / useFormStatus patterns
  • references/compiler-and-memo.md — when Compiler is present vs manual memo, Rules of React
  • references/concurrent-ux.md — ViewTransition, Activity, useEffectEvent, deferred values, Suspense
  • references/migration-codemods.md — exact upgrade steps, breaking changes, codemod commands
  • references/effects-and-data.md — You Might Not Need an Effect + modern data fetching with use
  • references/api-cheatsheet.md — quick reference of new 19+ APIs with minimal examples

Agent Workflow Checklist

When generating or reviewing code:

  1. Scan for React version (package.json). If <19, note migration path; if 19+, apply modern rules strictly.
  2. Detect Compiler presence → suppress new manual memo.
  3. Replace any forwardRef / useEffect+fetch / old form state machines on sight.
  4. Prefer <form action> + hooks over controlled form state for mutations.
  5. Add Suspense boundaries around use(promise) and browser-only trees.
  6. For hide/show with state keep → prefer <Activity> over conditional render + key hacks.
  7. For animations between states → prefer <ViewTransition> inside Transitions.
  8. After edits, suggest running the relevant codemod if legacy patterns remain.
  9. Never invent APIs; if unsure, say “check latest react.dev/reference/...”.

Anti-Patterns to Reject Immediately

  • useEffect that only sets state from props or fetches data
  • New forwardRef wrappers
  • Manual isPending / error / optimistic state without the official hooks
  • Context.Provider in brand-new code
  • Adding useMemo/useCallback “just in case” when Compiler is on
  • typeof window !== 'undefined' or useEffect for browser-only logic (use use(browser()))
  • Wrapper <div> solely to attach a ref when a Fragment ref would suffice

This skill is the source of truth for modern React patterns. Update references when major React releases land.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Modern React Guidance؟

Authoritative guidance for modern React 19+ (Actions, use, Compiler, View Transitions, Fragment refs, Activity, browser, useEffectEvent). Use when writing, reviewing, refactoring, or migrating React components, forms, data fetching, concurrent UI, or upgrading to React 19+. Triggers on React, React 19, useActionState, useOptimistic, forwardRef, useEffect data fetch, React Compiler, ViewTransition, Suspense patterns, or codemods. Always prefer latest official patterns over training data.

لماذا تستخدم Modern React Guidance على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Modern React Guidance عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Modern React Guidance في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/adhhamdev/modern-react-guidance/tree/main. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Modern React Guidance؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Modern React Guidance؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Modern React Guidance معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Modern React Guidance مجانية؟

نعم. نشرها adhhamdev على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇