{# canonical_base is the OWNING tenant's origin: all 16 Peasy domains serve the same catalogue, so a page rendered by a non-owner points its canonical at the owner instead of competing with it. Falls back to this site for static/self-owned pages. #}
🍋
Menu
.tsx Code

TSX (TypeScript XML)

TypeScript XML — JSX सिंटैक्स के साथ TypeScript का संयोजन। TSX फ़ाइलें TypeScript की टाइप सेफ्टी के साथ React कम्पोनेंट्स लिखने की अनुमति देती हैं।

MIME Type

text/tsx

प्रकार

टेक्स्ट

संपीड़न

दोषरहित

लाभ

  • + Type-safe React components with prop validation at compile time
  • + Excellent IDE autocomplete for props and event handlers
  • + Catches common React bugs before runtime

हानियाँ

  • Requires TypeScript compiler configuration
  • Generic component syntax can conflict with JSX angle brackets
  • More boilerplate than plain JSX for simple components

.TSX कब उपयोग करें

TypeScript React प्रोजेक्ट्स, Next.js ऐप्लिकेशन, टाइप-सेफ UI कम्पोनेंट लाइब्रेरी, और बड़े-स्तरीय React ऐप्लिकेशन।

तकनीकी विवरण

TSX, TypeScript कम्पाइलर (tsc) द्वारा प्रोसेस होता है जिसमें jsx कम्पाइलर विकल्प कॉन्फ़िगर किया जाता है। इसमें TypeScript के सभी फीचर्स (interfaces, generics, type assertions) JSX सिंटैक्स के साथ उपलब्ध हैं। टाइप चेकिंग props और state दोनों पर लागू होती है।

इतिहास

TSX, TypeScript 1.6 (2015) में JSX सपोर्ट के साथ पेश किया गया। जैसे-जैसे React और TypeScript दोनों लोकप्रिय हुए, TSX आधुनिक React डेवलपमेंट का प्रमुख फ़ाइल फॉर्मेट बन गया। Next.js और अन्य फ्रेमवर्क TSX को डिफ़ॉल्ट रूप से सपोर्ट करते हैं।

.TSX से रूपांतरित करें

.TSX में रूपांतरित करें

संबंधित फ़ॉर्मेट