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

Components as classes

The following code snippet declares three components named Container, Row, and Column. These components extend the Component class, which is imported from the React module. There are a few methods that we can implement in a class that extends the Component class, but at a bare minimum, we must implement the render method.

The Container, Row, and Column components are used to control the layout of a page. These components use the CSS classes from the Bootstrap (a library that allow us to style our application with ease) grid system. In Bootstrap, the layout has a maximum of 12 columns, and a different size can be declared for a given screen size:

import * as React from "react"; export class Container extends React.Component ...
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