safe-element-comparison

Preserve safe element type comparisons in Remix Forms component mappings.

516|25|Updated Feb 24, 2022
One-click install
npx skills add https://github.com/seasonedcc/remix-forms --skill safe-element-comparison
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe-element-comparison
Source: https://github.com/seasonedcc/remix-forms/tree/main/.claude/skills/safe-element-comparison
Command: npx skills add https://github.com/seasonedcc/remix-forms --skill safe-element-comparison

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remix Forms identifies components in JSX trees using child.type === Component. This skill covers the architecture, the rules for keeping it safe, and guidance for users.

Core Features & Use Cases

  • Architecture overview of mapChildren and how default wrappers preserve identity.
  • Rules to avoid string-based comparisons and to ensure unique identities using module-scope React.forwardRef wrappers.
  • Guidance for diagnosing issues when users report unexpected attributes or prop injections.

Quick Start

Verify your Remix Forms usage by passing component references (not strings) for identity-sensitive props.

Frequently Asked Questions about safe-element-comparison

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

FAQPage Schema
Why does my React component receive unexpected props in Remix Forms?

Unexpected attributes appear when Remix Forms uses `child.type === Component` for identification, and component identity is lost. This Skill diagnoses mapChildren issues by enforcing safe element type comparisons to prevent incorrect prop injections.

How do I preserve component identity when customizing Remix Forms components?

Apply module-scope React.forwardRef wrappers to preserve unique identities. This approach ensures safe element type comparisons during mapChildren modifications, keeping injected props targeted correctly.

What is the best way to avoid string-based comparisons in React component mapping?

Avoid string-based comparisons and use module-scope React.forwardRef wrappers. This enforces architecture rules that maintain unique component identities and prevent incorrect prop injections during component mapping.

How do I test React forwardRef identity preservation for Remix Forms?

Verify unique identities are preserved and confirm plain HTML counterparts do not receive injected props. These tests ensure safe element type comparisons function correctly during Remix Forms modifications.

Can I modify component mappings in Remix Forms without breaking prop injection?

You can safely modify component mappings by preserving safe element type comparisons. This requires applying module-scope React.forwardRef wrappers to maintain unique identities and prevent incorrect prop injections.

When do I need safe element type comparisons in React?

You need safe element type comparisons when modifying component mappings or debugging mapChildren in Remix Forms. This prevents incorrect prop injections by ensuring unique component identities remain preserved.