React has been the dominant frontend library for building user interfaces since its introduction by Facebook in 2013. In 2026, it holds a 69.7% market share among JavaScript frameworks, running on over 5.2 million active domains. Companies of all sizes — from startups to enterprises like Amazon, IBM, McDonald’s, and Accenture — build their applications on React.
The library’s component-based architecture, backed by a massive ecosystem including Next.js, Remix, and React Native, makes it the most in-demand frontend skill in the job market. Whether you are aiming for a frontend role or looking to strengthen your full-stack capabilities, React is the default choice for modern web development.
About the book
How To Code in React.js by Joe Morgan, published by DigitalOcean, is a comprehensive hands-on guide to building modern web applications with React. The book takes a practical approach — every chapter walks you through a real project from start to finish.
You will start by setting up a development environment with Create React App, then progressively build your understanding from basic JSX syntax to advanced concepts like state management with Redux, authentication, routing, and deployment.
No prior React experience is required. The book assumes basic familiarity with JavaScript, HTML, and CSS, and builds on those foundations throughout. Each chapter is self-contained, so you can jump directly to the topic you need or follow the full curriculum in order. By the end, you will have built multiple working applications and gained the confidence to create production-grade React projects on your own.
What you will learn
- Set up a React project using Create React App and understand its structure
- Create React elements and components with JSX syntax
- Customize components with props and create reusable wrapper components
- Style React components using CSS modules and inline styles
- Manage component state with class components and modern Hooks (useState, useEffect, useContext)
- Share state across components with Context API and Redux
- Debug React applications using React Developer Tools
- Handle DOM events, window events, and build interactive forms
- Implement lazy loading, code splitting, and async data loading
- Call Web APIs using the useEffect hook
- Handle routing in single-page applications with React Router
- Add login authentication to protect routes and manage sessions
- Optimize performance with memo, useMemo, and useCallback
- Deploy React applications to production with Nginx or DigitalOcean App Platform
Table of contents
- About DigitalOcean
- Introduction
- How To Set Up a React Project with Create React App
- How To Create React Elements with JSX
- How To Create Custom Components in React
- How To Customize React Components with Props
- How To Create Wrapper Components in React with Props
- How To Style React Components
- How To Manage State on React Class Components
- How To Manage State with Hooks on React Components
- How To Share State Across React Components with Context
- How To Debug React Components Using React Developer Tools
- How To Handle DOM and Window Events with React
- How To Build Forms in React
- How To Handle Async Data Loading, Lazy Loading, and Code Splitting with React
- How To Call Web APIs with the useEffect Hook in React
- How To Manage State in React with Redux
- How To Handle Routing in React Apps with React Router
- How To Add Login Authentication to React Applications
- How To Avoid Performance Pitfalls in React with memo, useMemo, and useCallback
- How To Deploy a React Application with Nginx on Ubuntu 20.04
- How To Deploy a React Application to DigitalOcean App Platform
Book details
- Title: How To Code in React.js
- Author(s): Joe Morgan
- Publication year: 2021
- Publisher: DigitalOcean
- Pages: 962
- PDF size: 19.1 MB
- Estimated reading time: ~24 h
- Level: Beginner to Intermediate
- Main category: Programming
- Subcategory: JavaScript
- Language: English
- License: CC BY-NC-SA 4.0
More books in: JavaScript, Programming
Legal notice: This book is shared for educational purposes only. The content is distributed under Creative Commons licenses or with explicit permission from the author. FreeProgrammingBooks may host files that comply with their respective licenses.