If you want to learn how to build efficient React applications, this is your book. Ideal for web developers and software engineers who understand how JavaScript, CSS, and HTML work in the browser, this updated third edition provides best practices and patterns for writing modern React code. No prior knowledge of React or functional JavaScript is necessary. Using their learning road map, authors Alex Banks and Eve Porcello show you how to create UIs that can deftly display changes without page reloads on large-scale, data-driven websites.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Learning React: Modern Patterns for Developing React Apps
【One-Line Pitch】
A practical, hands-on guide for web developers who know HTML, CSS, and JavaScript and want to master React from the ground up—covering everything from modern JavaScript syntax to state management, routing, testing, and server rendering, with no prior React experience required.
【Book Arc】
- **Opening (~0%–6%)**: Introduces the book's purpose, target audience, and learning roadmap. The authors promise to cover not just basics but also state management, React Router, testing, and server rendering, with all examples available in a companion GitHub repository.
- **Early (~6%–16%)**: Establishes the JavaScript foundation needed for React. Covers the evolution of ECMAScript, the role of the ECMA committee, and the importance of understanding modern JavaScript features before diving into React itself.
- **Early (~16%–28%)**: Dives into core JavaScript concepts essential for React development—variable scoping with `let` and `const`, template strings for cleaner string interpolation, and the shift from `var` to block-scoped declarations.
- **Early (~28%–38%)**: Explores function creation patterns, including function declarations, expressions, default parameters, and arrow functions. Emphasizes how these syntax choices affect readability and behavior.
- **Middle (~38%–47%)**: Addresses the critical topic of `this` binding and scope in JavaScript, showing why arrow functions behave differently from regular functions. Introduces JavaScript compilation with Babel and modern build tools like Vite, esbuild, and SWC.
- **Middle (~47%–53%)**: Moves into objects and arrays—destructuring, object literal enhancement, and the spread operator—techniques widely used throughout React codebases.
【Key Takeaways】
- **Modern JavaScript is the prerequisite for React** (Early): The book deliberately starts with ECMAScript history and features because React code is written in modern JavaScript. Understanding `let`, `const`, and block scoping prevents common bugs before they happen.
- **Block scoping with `let` solves real problems** (Early): The classic `for` loop closure bug—where every click handler sees the final loop value—disappears when you declare the counter with `let` instead of `var`. This is a concrete, motivating example of why syntax matters.
- **Template strings transform string handling** (Early): With backticks and `${}` interpolation, you can build multi-line strings, HTML templates, and email content without ugly concatenation. Whitespace is preserved, making embedded HTML readable and maintainable.
- **Arrow functions offer concise syntax with trade-offs** (Middle): One-line arrow functions eliminate the `function` and `return` keywords, but they don't block `this` scope. Using an arrow function for an object method can cause `this` to refer to the window object, breaking your code.
- **Default parameters make functions more robust** (Middle): Both strings and objects can serve as defaults, so functions run correctly even when arguments are omitted. This reduces boilerplate error checking.
- **Compilation bridges the browser gap** (Middle): Tools like Babel, esbuild, and SWC transform modern JavaScript into widely compatible syntax. Babel's output for arrow functions with defaults shows how the `arguments` array is used to simulate default values in older environments.
- **Destructuring is a React staple** (Middle): Pulling specific fields from objects and arrays into local variables is idiomatic React. The sandwich example—extracting only `bread` and `meat`—demonstrates how to keep code focused and readable.
【Reading Tips】
- **Skim the ECMAScript history section** (~6%–9%): The timeline of language versions is interesting context, but the practical value comes from the feature examples that follow. Don't get bogged down in committee details.
- **Deep-read the scoping and `this` sections** (~25%–44%): These are the most error-prone areas for JavaScript developers. Work through the `for` loop example and the `tahoe` mountain example carefully—they illustrate bugs you'll likely encounter.
- **Practice with the GitHub repository**: The authors explicitly point to https://github.com/moonhighway/learning-react for hands-on examples. Type the code yourself rather than just reading it.
- **Use the Babel REPL to experiment** (~47%): The book suggests trying the Babel REPL to see how modern syntax compiles to older JavaScript. This is an excellent way to understand what your code becomes in the browser.
- **Pay attention to arrow function scope warnings** (~44%): The contrast between a working `print` method and its broken arrow-function version is a trap many developers fall into. Mark this section for future reference.
【Coverage Limits】
The excerpts cover the book's front matter, JavaScript foundation chapters, and early object/array techniques. They do not yet cover React-specific topics like components, JSX, state management, React Router, testing, or server rendering—those appear later in the book and are not represented in this sample.
Excerpt 1
27: First Release See http://oreilly.com/catalog/errata.csp?isbn=9781098175948 for release details. The O’Reilly logo is a registered trademark of O’Reilly M...
1997, ECMAScript1. This was followed in 1998 by ECMAScript2. ECMAScript3 came out in 1999, adding regular expressions, string handling, and more. The process...
sed to create a function and the anatomy of those functions. Function Declarations A function declaration or function definition starts with the function key...
s that belong to your project that don’t run in the browser. As an example, let’s look at an arrow function with some default arguments: const add = ( x = 5...
(); console . log ( last ); // Rose console . log ( peaks . join ( ", " )); // Tallac, Ralston, Rose Since we used the spread operator to copy the array, the...
eved, or flow through your applications just like variables. Imperative Versus Declarative Functional programming is a part of a larger programming paradigm:...
rateColor function is exactly the same as the previous one. It treats color as an immutable object, does so with less syntax, and looks a little bit cleaner....
s checking every school to see if its name begins with a “W.” When it’s time to remove an item from an array, we should use Array.filter over Array.pop or Ar...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Learning React (Alex Banks, Eve Porcello)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Learning React (Alex Banks, Eve Porcello)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment