Skip to Content
Learning React
book

Learning React

by Alex Banks, Eve Porcello
May 2017
Intermediate to advanced content levelIntermediate to advanced
348 pages
7h 34m
English
O'Reilly Media, Inc.
Content preview from Learning React

Chapter 12. React and the Server

So far, we have built small applications with React that run entirely in the browser. They have collected data in the browser and saved the data using browser storage. This makes sense because React is a view layer. It is intended to render UI. However, most applications require at least the existence of some sort of a backend, and we will need to understand how to structure applications with a server in mind.

Even if you have a client application that is relying entirely on cloud services for the backend, you still need to get and send data to these services. Within the scope of Flux, there are specific places where these transactions should be made, and libraries that can help you deal with the latency associated with HTTP requests.

Additionally React can be rendered isomorphically, which means that it can be in platforms other than the browser. This means we can render our UI on the server before it ever gets to the browser. Taking advantage of server rendering, we can improve the performance, portability, and security of our applications.

We start this chapter with a look at the differences between isomorphism and universalism and how both concepts relate to React. Next, we will look at how to make an isomorphic application using universal JavaScript. Finally, we will improve the color organizer by adding a server and rendering the UI on the server first.

Isomorphism versus Universalism

The terms isomorphic and universal are often used to ...

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

React and React Native

React and React Native

Adam Boduch
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781491954614Errata Page