react-syntax-components
Installation
SKILL.md
react-syntax-components
Quick Reference
Function Component Typing
| Pattern | Syntax | When |
|---|---|---|
| Props interface + return | function Comp(props: Props): React.ReactElement |
Default for all components |
| Destructured props | function Comp({ name, age }: Props) |
When accessing props directly |
| Generic component | function List<T>(props: ListProps<T>) |
Reusable data-driven components |
| Default props | { size = 'md' }: Props |
Optional props with defaults |
Component API Quick Lookup
| API | Purpose | React 18 | React 19 |
|---|---|---|---|
React.memo |
Skip re-render when props unchanged | Yes | Yes (Compiler reduces need) |
forwardRef |
Pass ref through component | Required | DEPRECATED -- use ref as prop |
Related skills