Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

Working with react-dom and JSX

Now that we know how we can use Webpack to build our frontend application and how we can use Express.js to serve its static files, we can focus on the code of the React application. We are going to start by examining the entry point of our frontend application. The application's entry point is located at /web/frontend/index.tsx.

As you can see, we have used the file extension .tsx instead of the .ts extension. This is the case because we are going to use a template system known as JSX. TypeScript supports JSX natively, but it requires us to use the .tsx file extension and to configure the JSX settings in our tsconfig.json file:

"jsx": "react" 

The JSX setting determines if the JSX code should be compiled into ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content