solid-syntax-context

Create typed contexts with createContext, useContext, and Provider for SolidJS component trees.

4|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/SolidJS-Claude-Skill-Package --skill solid-syntax-context
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solid-syntax-context
Source: https://github.com/OpenAEC-Foundation/SolidJS-Claude-Skill-Package/tree/main/skills/source/solid-syntax/solid-syntax-context
Command: npx skills add https://github.com/OpenAEC-Foundation/SolidJS-Claude-Skill-Package --skill solid-syntax-context

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Sharing and injecting state across SolidJS components is error-prone when porting patterns from React. This Skill provides a typed context API (createContext, useContext, and Provider) to enable predictable, scoped state sharing and dependency injection across component trees.

Core Features & Use Cases

  • Typed contexts with createContext and useContext, plus a guard-enabled hook to enforce Provider presence.
  • Support for reactive values via signals and stores, ensuring changes propagate efficiently without breaking reactivity.
  • Nested Providers and override capabilities for scoped state and clean dependency injection in complex UIs.

Quick Start

Create a separate module that exports a typed useContext hook, wrap your app with a Provider, and consume the context in components through the hook.

Frequently Asked Questions about solid-syntax-context

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

FAQPage Schema
How do I share state across SolidJS components without breaking reactivity?

SolidJS uses createContext and useContext for dependency injection, but unlike React, passing direct signal reads can break fine-grained reactivity, so you must pass-by-accessors or use store proxies to maintain predictable state propagation across the component tree.

What is the best way to set up nested providers for dependency injection in SolidJS?

Nested providers in SolidJS are set up by exporting a typed useContext hook from a separate module, wrapping components with a Provider, and leveraging context override capabilities to ensure scoped state and clean dependency injection across complex UIs.

How do I enforce that a SolidJS context Provider is present before consuming it?

To enforce Provider presence in SolidJS, use a guard-enabled useContext hook that validates the context existence before returning values, ensuring components fail safely if rendered outside the required Provider scope.

How do I pass signals and stores through SolidJS context safely?

Pass signals and stores through SolidJS context safely by passing accessors or store proxies rather than direct signal reads, which preserves fine-grained reactivity and ensures efficient change propagation across nested components.

Can I override context values for specific subtrees in a SolidJS application?

SolidJS supports context overrides for specific subtrees by nesting Providers within the component tree, enabling scoped state and clean dependency injection where child contexts override parent values without affecting siblings.

Why does my SolidJS context value stop updating when I pass signals directly?

Direct signal reads in SolidJS context break fine-grained reactivity, causing updates to stop propagating, so passing accessors or store proxies instead ensures reactive values continue to update efficiently across the component tree.