react

TypeScript/React code standards. Use when writing or reviewing React components, hooks, or TypeScript code.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "react" with this command: npx skills add vainjs/skills/vainjs-skills-react

Standards Detection

Search for ESLint config (.eslintrc.*, eslint.config.*, package.json). If found, merge with baseline (ESLint takes precedence). Otherwise use baseline only.

Baseline Standards

Types & Imports

  • Use type (not interface)
  • Use import type for type-only imports
  • Naming: ComponentNameProps, UseHookNameOptions
  • Order: types → libraries → components → utilities → styles

Naming

ElementConventionExample
ComponentsPascalCaseUserProfile
Variables/functionscamelCasegetUserData
ConstantsUPPER_SNAKE_CASEMAX_RETRY_COUNT
Event handlerson*onClick
Hooksuse*useAuth

Components

  • Functional components with arrow functions
  • Destructure props with defaults
  • Named exports preferred
  • Set displayName
  • Memoize: useCallback for callbacks, useMemo for computations
  • Early returns for guards
  • Conditional rendering with &&

Custom Components

type ComponentNameProps = {}

export const ComponentName: FC<ComponentNameProps> = props => {
  const {} = props
}

ComponentName.displayName = 'ComponentName'

Custom Hooks

export function useHookName(options: UseHookNameOptions) {
  const { a, b } = options
  // a, b
  return {}
}

Code Style

  • TypeScript strict mode
  • Avoid any → use unknown or specific types
  • Prefer const over let
  • Single responsibility functions

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

react

No summary provided by upstream source.

Repository SourceNeeds Review
General

react

No summary provided by upstream source.

Repository SourceNeeds Review
General

react

No summary provided by upstream source.

Repository SourceNeeds Review
General

commit

No summary provided by upstream source.

Repository SourceNeeds Review