Skip to Main Content
Mastering TypeScript 3 - Third Edition
book

Mastering TypeScript 3 - Third Edition

by Nathan Rozentals
February 2019
Beginner content levelBeginner
694 pages
18h 4m
English
Packt Publishing
Content preview from Mastering TypeScript 3 - Third Edition

React ItemView

React models, similar to Aurelia and Angular models, are simple TypeScript classes. As we have covered these models in both of the previous sections, we will jump straight in and take a look at how React composes views.

Firstly, let's create a src/ReactApp.tsx source file. Within this file, we will create two views. The first view will be a view for each individual element of the ClickableItemArray, and will be named ItemView. The second view will be named ItemCollectionView, and will render the entire array. This is similar to the two views that we created in Backbone. We will start with the ItemView as follows:

import * as React from 'react'; import * as _ from 'underscore'; export class ItemModel { DisplayName: string = ...
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

The TypeScript Workshop

The TypeScript Workshop

Ben Grynhaus, Jordan Hudgens, Rayon Hunte, Matt Morgan, Wekoslav Stefanovski

Publisher Resources

ISBN: 9781789536706Supplemental Content