Fix MobX Reactivity Issues

Diagnose and fix MobX reactivity issues in Phoenix/FAAD HMI UI components.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/biggs3d/Tools --skill fix-mobx-reactivity-issues
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Fix MobX Reactivity Issues
Source: https://github.com/biggs3d/Tools/tree/main/.ai-guidance/.claude/skills/fix-mobx-reactivity
Command: npx skills add https://github.com/biggs3d/Tools --skill fix-mobx-reactivity-issues

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Diagnoses and resolves common MobX reactivity problems where UI fails to update despite state changes, computed values not recalculating, or async updates not propagating.

Core Features & Use Cases

  • Identify and fix common MobX pitfalls (e.g., missing observer, missing makeObservable, improper async updates).
  • Provide concrete, publish-ready code fixes aligned with MOBX_ESSENTIALS guidelines.
  • Include step-by-step patterns and best practices to prevent regressions.

Quick Start

Describe observed symptom (e.g., "UI not updating after state change") and request recommended fixes (e.g., wrap updates in runInAction, ensure makeObservable in constructor).

Frequently Asked Questions about Fix MobX Reactivity Issues

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why isn't my MobX UI updating when state changes?

UI fails to update in MobX when components aren't wrapped with observer() or state isn't marked as observable via makeObservable(). Ensure observer wraps your React component and makeObservable is called in the constructor to make properties reactive.

How do I fix computed values that aren't recalculating in MobX?

Computed values stop recalculating when their dependencies aren't observable or when the computed property itself isn't declared. Verify all dependencies are observable and declare computed properties using makeObservable with the computed annotation.

How do I update MobX state after async operations?

Async updates don't propagate in MobX when state mutations occur outside actions. Wrap post-await mutations in runInAction to ensure changes trigger reactivity and update the UI after API calls or promises resolve.

What's the proper way to update arrays in MobX?

Mutating arrays directly in MobX doesn't trigger updates; replace the entire array instead. Use assignment (store.items = newArray) or methods like splice on a fresh copy to ensure MobX detects the change and re-renders observers.

Can I use MobX best practices to prevent reactivity regressions?

Yes. Follow MobX_Essentials guidelines: wrap components with observer, call makeObservable in constructors, use runInAction for async state changes, and replace arrays rather than mutating them to maintain consistent reactivity.

Does MobX work with async state updates in UI components?

MobX works with async operations when you wrap post-await mutations in runInAction. Without runInAction, state changes after awaits don't notify observers, causing stale UI despite successful data fetches.