Open-source project
MoonHighway/learning-react avatar
MoonHighway/learning-react

Learning React, Second Edition: A Chapter-by-Chapter Code Companion

GitHub describes it as The code samples for Learning React by Alex Banks and Eve Porcello, published by O'Reilly Media. The repository metadata lists JavaScript as its primary language. This article stays within the project description and details documented in the GitHub repository README.

3,744 stars1,269 forksJavaScriptLicense varies

At a glance

What is it?
MoonHighway/learning-react is the official code repository for the O'Reilly book by Alex Banks and Eve Porcello. It mirrors the book's chapters, from basic JSX to Suspense and server-side React, and is best used as a reading companion, not a standalone project.
Who is it for?
Adopt this repository if you are reading Learning React, Second Edition and want to follow along with working code examples. Skip it if you need a production-ready template or a standalone tutorial, because the samples are tied to the book's narrative and lack a package.json at the root.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Activity is slowing. The repository last received commits 8 months ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • MoonHighway/learning-react3,744 ★ · +7
Star history
Repository2026-08-132026-10-22
MoonHighway/learning-react3.7k3.7k

7 Stars in the last 70 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

A Companion Repository, Not a Standalone Project

This repository exists to accompany a specific book. The README states it contains the files for Learning React by Alex Banks and Eve Porcello, published by O'Reilly. That is its entire purpose. There is no root-level package.json, no build script, and no application to run. Each chapter is a separate directory, and the default branch is second-edition. If you are not reading the book, this repository offers little on its own. It is a resource for following along, not a starting point for a new project.

Chapter Structure Mirrors the Book's Learning Path

The repository is organized by chapter, from chapter-01 to chapter-12. Each folder corresponds to a chapter in the book. The table of contents in the README maps each directory to a topic: Welcome to React, Emerging JavaScript, Functional Programming, Pure React, React with JSX, State Management, Hooks, Incorporating Data, Suspense, Testing, React Router, and React and the Server. This structure lets you jump to the exact section you are reading. The progression is deliberate: early chapters cover JavaScript fundamentals, then move to React basics, and later chapters tackle advanced topics like Suspense and server-side rendering.

How the Code Samples Work

Each chapter directory contains code examples that illustrate the concepts discussed in the book. For example, chapter-04 is Pure React, which likely shows how to create React elements without JSX, while chapter-05 covers React with JSX, showing the syntax change. The examples are meant to be read alongside the text. The README does not provide explicit installation instructions, but based on typical React projects, you would need to navigate into a chapter directory and run npm install if a package.json exists there. The repository does not have a single unified build, so each chapter is self-contained. This is a trade-off: you get focused examples, but you lose the convenience of one command to run everything.

Getting Started: What You Need to Do

To use the repository, clone it with git clone https://github.com/MoonHighway/learning-react.git. Then check out the second-edition branch, which is the default, but the README notes that the first edition files are on the master branch. For each chapter, you will likely need to install dependencies. The README does not list specific commands, so you should look for a package.json inside each chapter folder. If present, run npm install and then npm start or a similar script. For chapters that are just code snippets, you might run them directly with Node.js. Since the repository does not provide a top-level guide, you must inspect each chapter's files to determine the intended workflow.

Limitations: Outdated Dependencies and Lack of Support

The repository was last pushed at an unknown time, and there are no recent releases. The book's second edition covers React Hooks and Suspense, which were introduced in React 16.8 and 16.6 respectively. That means the code samples may use older versions of React and related libraries. If you are using React 18 or 19, some examples might not work without updates. Also, the repository has no license listed, which is a concern. Without a license, you cannot legally reuse the code in your own projects without permission. This is not a limitation for reading, but it is a problem if you plan to copy snippets into a commercial application.

When This Repository Is the Wrong Tool

If you are an experienced developer looking for best-practice patterns, this repository is not for you. The code is pedagogical, meaning it is simplified to teach concepts. It may not follow production-grade patterns. For example, chapter-07 on Hooks likely shows basic useState and useEffect, but not advanced patterns like custom hooks or performance optimizations. Also, if you want to learn React without a book, this repository will be confusing because it lacks context. The README gives no overview of how to run the examples or what each file does. It assumes you have the book open. In that sense, it is a supplement, not a standalone tutorial.

Alternatives: Official React Docs and Create React App

A real alternative is the official React documentation at react.dev, which provides interactive tutorials and up-to-date examples. The docs are maintained by the React team and cover Hooks, Suspense, and server components with current versions. Another alternative is Create React App, a tool that scaffolds a new React project with a single command: npx create-react-app my-app. Unlike this repository, Create React App gives you a working application with a build system and development server. The difference is that the learning-react repository is static code samples, while the official docs and CRA are dynamic, evolving resources. If you want to learn React from scratch, the docs are more comprehensive and current.

Maintenance and Upgrade Cost

The repository is not actively maintained. There are no recent releases, and the last push is unknown. This is typical for a book's code repository: it is updated only when a new edition is published. The second edition is the current one, and the first edition is on a separate branch. If you want to use the code with newer React versions, you will need to manually upgrade dependencies. That cost is low if you are just reading, but high if you intend to run the examples. The lack of a license also means you cannot legally modify and redistribute the code without contacting the authors. For learning purposes, this is fine, but for any other use, you need to seek permission.

Editorial conclusion

Adopt this repository if you are reading Learning React, Second Edition and want to follow along with working code examples. Skip it if you need a production-ready template or a standalone tutorial, because the samples are tied to the book's narrative and lack a package.json at the root. Before using any chapter, check the branch (second-edition is default) and verify the React version in that chapter's package.json, since the book covers Hooks and Suspense, which may not match your current setup.

Frequently asked questions

Where do I find the code for the second edition of Learning React?

In twelve directories named chapter-01 through chapter-12, each matching a chapter title. The default branch of the repository is named second-edition, so the chapter links in the table of contents point into that branch.

How is the first edition of Learning React kept?

On a separate branch. The README points readers who want the first edition files to the first-edition branch, which lives on the master branch path, while the newer material sits on the default branch named second-edition.

What order does the Learning React sample code teach in?

Welcome To React, then Emerging JavaScript, then Functional Programming with JavaScript, then Pure React, React with JSX, React State Management, Enhancing Components with Hooks, Incorporating Data, Suspense, Testing, React Router, and React and the Server.

Can I reuse the sample code from the learning-react repository?

The repository declares no licence and reports it as unknown, and it publishes no releases or tags. The files are the sample code for a book sold through Amazon and the O'Reilly shop, so reuse terms come from the publisher or the authors rather than from the repository.

Official sources

  1. Official README
  2. Project repository
  3. README
  4. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/moonhighway-learning-react.svg)](https://hysenlabs.com/projects/moonhighway-learning-react)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/moonhighway-learning-react.svg)](https://hysenlabs.com/projects/moonhighway-learning-react)