Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
openaec-foundation avatar

React Core Architecture

  • 11 installs
  • 6 repo stars
  • Updated July 8, 2026
  • openaec-foundation/react-claude-skill-package

Helps with frontend development tasks.

About

react-core-architecture is a Claude Code skill for frontend development. It helps solo builders move faster with AI-assisted development.

  • react-core-architecture
  • Frontend Development
  • AI-coding skill

React Core Architecture by the numbers

  • 11 all-time installs (skills.sh)
  • Ranked #1,658 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/openaec-foundation/react-claude-skill-package --skill react-core-architecture

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs11
repo stars6
Last updatedJuly 8, 2026
Repositoryopenaec-foundation/react-claude-skill-package

What it does

Helps with frontend development tasks.

Files

SKILL.mdMarkdownGitHub ↗

react-core-architecture

Quick Reference

Architecture Layers

LayerRoleKey Concept
React ElementsLightweight descriptions of UIImmutable objects created by JSX/createElement
ComponentsFunctions that return elementsPure functions of props and state
Fiber TreeInternal work-in-progress treeEnables incremental rendering and prioritization
ReconcilerDiffing algorithmCompares previous and next element trees
RendererPlatform-specific outputreact-dom for web, react-native for mobile

Core Principles

PrincipleRule
Unidirectional Data FlowData ALWAYS flows from parent to child via props
Declarative UIALWAYS describe what the UI should look like, NEVER imperatively mutate the DOM
Composition over InheritanceALWAYS compose components, NEVER use class inheritance for component reuse
Pure RenderingThe render phase MUST be a pure function of props and state
Immutable UpdatesNEVER mutate state or props directly; ALWAYS create new references

React Element vs Component

ConceptWhat It IsExample
React ElementImmutable plain object describing a DOM node or component{ type: 'div', props: { children: 'Hello' } }
ComponentFunction that accepts props and returns React elementsfunction Greeting({ name }: Props) { return <h1>{name}</h1>; }
FiberInternal mutable work unit tracking a component instanceNot directly accessible; managed by React internals

---

Critical Warnings

NEVER mutate state or props during rendering -- rendering MUST be a pure calculation. Mutations cause inconsistent UI and break concurrent features.

NEVER rely on render timing or count -- React MAY call your component multiple times, skip renders, or pause and resume rendering. StrictMode double-invokes components in development.

NEVER perform side effects in the render phase (network requests, subscriptions, DOM mutations) -- ALWAYS use useEffect or event handlers for side effects.

NEVER use inheritance to share behavior between components -- ALWAYS use composition (children, render props, or custom hooks).

NEVER call root.render() where hydrateRoot() is needed -- for server-rendered HTML, ALWAYS use hydrateRoot to preserve server markup and attach event handlers.

NEVER assume synchronous DOM updates after root.render() -- rendering is asynchronous. Use flushSync() ONLY when synchronous behavior is explicitly required.

---

Rendering Model

JSX Compilation

JSX is syntactic sugar for React.createElement() calls:

// JSX (what you write)
<Greeting name="Taylor" />

// Compiled output (what React sees)
createElement(Greeting, { name: 'Taylor' })

The returned React element is an immutable object:

{
  type: Greeting,       // Component function or string tag
  props: { name: 'Taylor' },
  key: null,
  ref: null
}

ALWAYS use capital letters for component names in JSX -- lowercase names resolve to HTML tags, not components.

Three-Phase Rendering Cycle

React updates the screen in three sequential steps:

PhaseWhat HappensInterruptible?
1. TriggerInitial root.render() call or a state update via setStateN/A
2. RenderReact calls component functions and diffs the element treeYes (concurrent mode)
3. CommitReact applies minimal DOM mutations to match the new treeNo (synchronous)

After the commit phase, the browser paints the updated screen.

Render Phase (Pure)

  • React calls your component function to produce a new element tree
  • Compares the new tree with the previous tree (reconciliation)
  • In concurrent mode (React 18+), this phase is interruptible -- React can pause, resume, or discard work
  • MUST be pure: no side effects, no DOM mutations, no subscriptions

Commit Phase (Synchronous)

  • React applies the minimal set of DOM changes identified during reconciliation
  • Runs useLayoutEffect cleanup and setup synchronously
  • The browser paints the screen
  • Runs useEffect cleanup and setup asynchronously after paint

Reconciliation Algorithm

React's diffing strategy uses two key heuristics:

1. Different element types produce different trees -- React tears down the old subtree and builds a new one 2. Keys identify which children remain stable across re-renders -- ALWAYS provide stable keys for list items

// React preserves <input> because the element type and position match
<div>
  <input value={text} />  {/* Same position, same type = preserved */}
</div>

---

Fiber Architecture (React 16+)

The Fiber reconciler replaced the legacy stack reconciler to enable:

CapabilityDescription
Incremental renderingSplit rendering work into chunks across multiple frames
Priority schedulingUrgent updates (user input) preempt lower-priority work
Pause and resumeInterrupt in-progress work without losing progress
Concurrent renderingPrepare multiple UI versions simultaneously (React 18+)

Each fiber node represents a component instance and contains:

  • type -- the component function or host element tag
  • stateNode -- the DOM node (for host elements) or component instance
  • child, sibling, return -- tree navigation pointers
  • memoizedState -- the linked list of hooks for this component
  • pendingProps, memoizedProps -- current and previous props
  • lanes -- priority bits for scheduling (React 18+)

NEVER access fiber internals directly -- they are private implementation details that change between React versions.

---

Component Lifecycle

Function Component Lifecycle

Mount:      Component called -> Elements created -> DOM inserted -> Effects run
Update:     State/props change -> Component re-called -> Reconciliation -> DOM patched -> Effects re-run
Unmount:    Effect cleanups run -> DOM removed
PhaseWhat RunsWhen
MountComponent function, then useEffect callbacksFirst render, after DOM insertion
UpdateComponent function, then useEffect cleanups + callbacks (if deps changed)On state or props change
UnmountuseEffect cleanup functionsWhen component is removed from tree

Entry Point: createRoot

import { createRoot } from 'react-dom/client';
import { StrictMode } from 'react';
import App from './App';

const root = createRoot(document.getElementById('root')!, {
  onCaughtError: (error, errorInfo) => {
    console.error('Caught:', error, errorInfo.componentStack);
  },
  onUncaughtError: (error, errorInfo) => {
    console.error('Uncaught:', error, errorInfo.componentStack);
  },
});

root.render(
  <StrictMode>
    <App />
  </StrictMode>
);

ALWAYS wrap the root in <StrictMode> during development to detect impure renders, missing effect cleanups, and deprecated APIs.

---

Component Tree Model

Render Tree

The render tree represents the component hierarchy for a single render pass:

  • Nodes are React components (not HTML elements)
  • Root node is the top-level component passed to root.render()
  • Top-level components near the root affect performance of all descendants
  • Leaf components at the bottom are frequently re-rendered

The tree changes dynamically with conditional rendering -- different state produces different subtrees.

Unidirectional Data Flow

State (parent) --> Props (child) --> Props (grandchild)
     ^                                      |
     |                                      |
     +-------- Callbacks (events) <---------+

Data flows DOWN through props. Communication UP happens through callback functions passed as props. NEVER pass data upward by mutating parent state from a child without using a callback.

---

StrictMode Behavior (Development Only)

CheckMethodPurpose
Impure renderingDouble-invokes component functionsCatches render-phase mutations
Missing effect cleanupRuns setup -> cleanup -> setup cycleCatches missing cleanup functions
Missing ref cleanupDouble ref callback cycleCatches ref-related memory leaks
Deprecated APIsStatic warningsFlags legacy lifecycle methods

StrictMode checks run ONLY in development. They have zero impact on production builds.

---

React 18 vs React 19

FeatureReact 18React 19
Concurrent renderingIntroduced via createRootStable, improved scheduling
Server ComponentsExperimentalStable
ref forwardingRequires forwardRef()ref is a regular prop
Context Provider<MyContext.Provider value={}><MyContext value={}>
Form handlingManual state managementBuilt-in Actions pattern
use() APINot availableReads Promises and Context in render
useActionStateNot availableManages async action state
useOptimisticNot availableOptimistic UI updates
Metadata tagsRequire react-helmet or similarNative <title>, <meta>, <link> hoisting
Error callbacksonRecoverableError onlyonCaughtError, onUncaughtError, onRecoverableError

---

Reference Links

  • references/examples.md -- Working code examples for rendering, lifecycle, and tree structure
  • references/api-table.md -- React core type reference and API signatures
  • references/anti-patterns.md -- What NOT to do, with explanations

Official Sources

  • https://react.dev/learn/render-and-commit
  • https://react.dev/learn/understanding-your-ui-as-a-tree
  • https://react.dev/reference/react/createElement
  • https://react.dev/reference/react-dom/client/createRoot
  • https://react.dev/reference/react/StrictMode
  • https://react.dev/blog/2024/04/25/react-19

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.