react-plugin-implementation

Implement React-based @canard/schema-form plugins with non-controlled components and memoized handlers.

1|Updated Nov 13, 2024
One-click install
npx skills add https://github.com/vincent-kk/albatrion --skill react-plugin-implementation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-plugin-implementation
Source: https://github.com/vincent-kk/albatrion/tree/main/.claude/skills/react-plugin-implementation
Command: npx skills add https://github.com/vincent-kk/albatrion --skill react-plugin-implementation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes and accelerates the creation of React-based @canard/schema-form plugins by outlining proven patterns for non-controlled components, test condition guidance, and performance optimizations.

Core Features & Use Cases

  • Non-controlled component patterns and testable defaults using defaultValue and useHandle.
  • Performance optimization guidance with useMemo and memoization strategies.
  • Clear plugin structure conventions including a SchemaFormPlugin export and formTypeInputDefinitions.

Quick Start

Inspect knowledge/component-patterns.md and knowledge/optimization-strategies.md to implement a new plugin following the recommended patterns, then export a plugin that matches the provided template.

Frequently Asked Questions about react-plugin-implementation

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

FAQPage Schema
How do I implement a React plugin for schema-form using non-controlled components?

You implement a schema-form plugin by adopting non-controlled component patterns that utilize defaultValue and useHandle to manage state independently. This structure exports a SchemaFormPlugin containing FormGroup, FormLabel, FormInput, and FormError components.

What is the best way to optimize performance in React schema-form plugins?

Performance optimization in React schema-form plugins is achieved by applying memoization strategies using useMemo and memoized handlers. This prevents unnecessary re-renders across form plugins in real-world UI systems.

How does the useHandle hook work in non-controlled form components?

The useHandle hook works by providing testable defaults for non-controlled form components. It manages local state independently of parent controllers, allowing form inputs to operate autonomously while maintaining testable condition tooling.

What structure do I need to export when creating a schema-form plugin?

When creating a schema-form plugin, you need to export a SchemaFormPlugin object. This structure must include FormGroup, FormLabel, FormInput, FormError, formatError, and formTypeInputDefinitions to ensure proper integration with the form system.

Can I use standard controlled components instead of non-controlled patterns for schema-form plugins?

While you can use controlled components, the schema-form plugin pattern advocates for non-controlled components instead. Non-controlled components provide better performance optimizations and testable defaults for real-world UI systems.