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 the react-router

In the preceding section, we learned how to use the render method from the react-dom module to render the Layout component. In this section, we are going to take a closer look at the Layout component.

As we can see in the code snippet below, the Layout component is a function that returns a series of nested JSX elements; some of these JSX elements are other React components (such as BrowserRouterHeader, and Switch components). This is the first time that we have seen the actual implementation of a React component. In this case, a React component is a function that returns some JSX. However, it is important to mention that this is not always the case as a component can also be a class.

React is a component-based ...

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