vue-jsx-best-practices

Explain Vue.js JSX attribute differences and TypeScript configuration.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/xurenlu/marstaff --skill vue-jsx-best-practices-xurenlu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-jsx-best-practices
Source: https://github.com/xurenlu/marstaff/tree/main/skills/vue-jsx-best-practices
Command: npx skills add https://github.com/xurenlu/marstaff --skill vue-jsx-best-practices-xurenlu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill clarifies the nuances and best practices for using JSX syntax within Vue.js projects, specifically highlighting differences from React's JSX to prevent common errors and ensure code consistency.

Core Features & Use Cases

  • Attribute Mapping: Understand when to use class vs className and for vs htmlFor.
  • Event Handling: Learn the correct way to handle events in Vue JSX.
  • TypeScript Configuration: Guides users on setting up tsconfig.json for proper Vue JSX type inference.
  • Use Case: A developer migrating a React project to Vue encounters TypeScript errors related to className. This Skill provides the exact solution and explanation.

Quick Start

Explain the difference between Vue JSX and React JSX regarding the 'class' attribute.

Frequently Asked Questions about vue-jsx-best-practices

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

FAQPage Schema
How do I use the class attribute in Vue JSX instead of className?

In Vue JSX, you should use the standard HTML attribute `class` instead of React's `className` to ensure proper type safety and code consistency within your Vue 3 project.

Why does my TypeScript configuration throw errors for Vue JSX attributes like htmlFor?

TypeScript throws errors because Vue JSX uses standard HTML attributes like `for` instead of React's `htmlFor`. Configuring `tsconfig.json` correctly for Vue JSX type inference resolves these errors.

What is the difference between Vue JSX and React JSX syntax?

The primary difference lies in attribute naming; Vue JSX uses standard HTML syntax like `class` and `for`, whereas React JSX uses `className` and `htmlFor` to maintain type safety and consistency.

How to configure tsconfig.json for Vue 3 JSX type inference?

Configure `tsconfig.json` by adjusting JSX settings to enable proper Vue 3 type inference, which addresses common gotchas and ensures type safety when migrating React JSX syntax.

What is the correct way to handle events in Vue JSX?

Handling events in Vue JSX requires understanding specific Vue.js syntax differences from React to prevent common errors and maintain code consistency across your TypeScript project.