February 2019
Beginner
694 pages
18h 4m
English
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 = ...