News

React and TypeScript Get Cozy

TypeScript 1.6 update adds support for React and JSX, which allows developers to use JSX syntax and TypeScript code interchangeably.

With the open source React JavaScript library gaining momentum as well as fans from the Microsoft developer community, it's only fitting that Microsoft's TypeScript team would be working to integrate React support into TypeScript. And that's what dropped this week: an update to TypeScript that adds support for React and JSX, as well as support for class expressions, abstract classes, and a variety of type system features.

React is an open source JavaScript library for creating composable user interfaces for data-intensive Web apps. It's currently under development, with version 0.14 the most recent release (you can follow its development on the React site here). JSX is an ECMAscript extension that resembles XML in syntax "without any defined semantics," according to a Facebook JSX draft specification on GitHub. It's used in conjunction with React since JSX's readability is simpler than JavaScript. The support directly in TypeScript 1.6 is streamlined with the addition of a new file extension, .tsx, wherein developers can intermingle JSX and TypeScript code.

"Our goal was to make it feel natural to work with React/JSX and to have all the type-checking and autocomplete capabilities of TypeScript," wrote Jonathan Turner, a program manager on the TypeScript team, in a blog yesterday. "This allows you a rich editing experience for working with React and JSX when using VS, VS Code, and Sublime." 

Also new is the addition of class expressions, a new feature that's intended to "round out the ES 6 support in TypeScript," said Turner. Class expressions are used for creating new classes in a way that's similar to class declarations, but they can be used in lieu of expressions. Also new are a number of additional features to the types system (user-defined type guard functions, an & type operator), support for abstract classes, and generic type aliases.

About the Author

You Tell 'Em, Readers: If you've read this far, know that Michael Domingo, Visual Studio Magazine Editor in Chief, is here to serve you, dear readers, and wants to get you the information you so richly deserve. What news, content, topics, issues do you want to see covered in Visual Studio Magazine? He's listening at [email protected].

comments powered by Disqus

Featured

  • Mastering Blazor Authentication and Authorization

    At the Visual Studio Live! @ Microsoft HQ developer conference set for August, Rockford Lhotka will explain the ins and outs of authentication across Blazor Server, WebAssembly, and .NET MAUI Hybrid apps, and show how to use identity and claims to customize application behavior through fine-grained authorization.

  • Linear Support Vector Regression from Scratch Using C# with Evolutionary Training

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the linear support vector regression (linear SVR) technique, where the goal is to predict a single numeric value. A linear SVR model uses an unusual error/loss function and cannot be trained using standard simple techniques, and so evolutionary optimization training is used.

  • Low-Code Report Says AI Will Enhance, Not Replace DIY Dev Tools

    Along with replacing software developers and possibly killing humanity, advanced AI is seen by many as a death knell for the do-it-yourself, low-code/no-code tooling industry, but a new report belies that notion.

  • Vibe Coding with Latest Visual Studio Preview

    Microsoft's latest Visual Studio preview facilitates "vibe coding," where developers mainly use GitHub Copilot AI to do all the programming in accordance with spoken or typed instructions.

  • Steve Sanderson Previews AI App Dev: Small Models, Agents and a Blazor Voice Assistant

    Blazor creator Steve Sanderson presented a keynote at the recent NDC London 2025 conference where he previewed the future of .NET application development with smaller AI models and autonomous agents, along with showcasing a new Blazor voice assistant project demonstrating cutting-edge functionality.

Subscribe on YouTube