Chapter 17. React on Node and Universal JavaScript
This chapter covers
- Using React on the server
- Understanding Universal JavaScript
- Using React on Node
- Working with React and Express
- Using Universal JavaScript with Express and React
React is primarily a front-end library to build full-blown, single-page applications or simple UIs on the browser. So why should we concern ourselves with using it on the server? Isn’t rendering HTML on the server the old way to do things? Well, yes and no. It turns out that when you build web apps that always render on the browser, they miss out on a few key goodies. In fact, they miss out to the point of not being able to rank high in Google search results and maybe even losing millions of dollars in revenue. Arghhh.
Read on to find out why. You can skip this chapter in only one case: if you’re oblivious to the performance of your apps (that is, if you’re a newbie developer). All others, please proceed. You’ll gain precious knowledge that you can use to build amazing apps and that will make you look smart during developers’ happy hour when you use the term Universal JavaScript. You’ll also learn how to use React with Node and build Node servers, and by the end of the chapter you’ll understand how to build Universal JavaScript apps with React.js and Express.js (the most popular Node.js framework).