1 Meeting React

 

This chapter covers

  • Understanding what React is
  • Solving problems with React
  • Fitting React into your web applications
  • Writing your first React web app: Hello World

React is the groundbreaking tool that web developers may not even know they need, but can’t let go of once they’ve tried. This is definitely true for the two authors of this book, as well as for many other enthusiastic web developers out there. React is immensely popular—and for good reason.

If you were doing web development in the early 2000s, all you needed was some HTML and a server-side language such as Perl or PHP. Ah, the good old days of putting in alert() boxes just to debug your frontend code. The internet has evolved a lot since then, and the complexity of building websites has increased dramatically. Websites have become web applications with complex user interfaces (UIs), business logic, and data layers that require changes and updates over time—and often in real time.

Many JavaScript template libraries have been written to try to solve the problems of complex UIs. But they still require developers to adhere to the old separation of concerns—which splits style (Cascading Style Sheets [CSS]), data and structure (HTML), and dynamic interactions (JavaScript)—and they don’t meet modern-day needs (remember DHTML?).

1.1 Benefits of using React

1.1.1 Simplicity

1.1.2 Speed and testability

1.1.3 Ecosystem and community

1.2 Disadvantages of React

1.3 How React can fit into your website

1.3.1 Single-page applications and React

1.3.2 The React stack

1.4 Your first React app: Hello World

1.4.1 The result

1.4.2 Writing the application

1.4.3 Installing and running a web server

1.4.4 Going to the local website

1.5 Quiz

sitemap