Logo

sr. Larry Ettinng

arrow_back Back to Blog
How I Learned React

How I learned React?

I decided to learn React in 2019 for a very pragmatic reason. PWA architecture was moving from conference slides into production roadmaps. By 2020, the headless push stopped being hype and started landing in real backlogs. That timing mattered. React did not feel optional anymore, at least not if you worked around Magento, commerce APIs, or anything customer facing at scale.

React is not a universal tool. Sometimes it is a bad fit. Sometimes it adds overhead without payoff. We think people underestimate that tradeoff. Still, once you step into headless commerce, React becomes hard to avoid. If you want a deeper discussion about when PWA architecture actually makes sense for Magento, there is a separate piece on getting started with Magento PWA Studio that covers decision criteria rather than enthusiasm.

Headless development multiplies what you need to understand. Frontend and backend evolve independently. That separation helps teams move faster, but it also raises the bar. Frontend developers can start without learning Magento internals, which is a relief. React, GraphQL, TypeScript, browser APIs. Familiar ground. But without backend data, storefronts stay empty shells. Inventory, pricing, checkout rules. Someone must design and maintain the API contract.

From a hiring perspective, this split helps. According to our analysts, it lowers the entry barrier for frontend roles. Still, coordination costs go up. That story deserves its own article.

When you start with React, the volume of learning material feels absurd

Courses, books, videos, blog posts. A lot of it ages badly. Some resources teach patterns that React itself has quietly abandoned. After roughly two years working with React and TypeScript outside client work, mostly nights and weekends, I narrowed down what actually helped me build production ready code without hating it later.

Before React, JavaScript must stop being fuzzy

React punishes weak JavaScript knowledge. Hooks, closures, immutability, reference equality. If ES6 still feels optional, React will feel hostile. According to our data, most beginner bugs trace back to misunderstanding scope or object identity, not React itself.

You should be comfortable with modern JavaScript syntax and semantics. That includes arrow functions, destructuring, spread operators, async and await, and array methods used functionally. MDN remains the most reliable reference. The JavaScript Guide and the sections on closures and promises matter more than trendy tutorials.

TypeScript changed how I write React

A solid TypeScript setup surfaced bugs during development instead of after deployment. It also slowed me down at first. That friction paid off. Types reduced guesswork and made refactoring possible without fear. Technical debt dropped noticeably.

If you have not used TypeScript, give it a serious attempt. Many React educators shifted their stance over the last few years. Kent C. Dodds, Josh Comeau, and others now default to TypeScript in examples. Plain JavaScript feels reckless once your components cross a certain size.

Resources that actually held up:

TypeScript Handbook by Microsoft
Free, updated, and boring in a good way. The sections on generics and narrowing deserve real attention. This is not inspirational reading. It is reference material you will return to.

https://www.typescriptlang.org/docs/handbook/intro.html

Total TypeScript by Matt Pocock
This course focuses on practical patterns used in modern React projects. According to our analysts, it aligns well with real world codebases that rely on inference rather than heavy annotation.

https://www.totaltypescript.com/

React learning material that aged well

React education suffers from churn. Class components, lifecycle methods, Redux everywhere. A lot of books still teach that worldview. Hooks changed how React code should look and think.

Foundation level:

The Beginner's Guide to React by Kent C. Dodds
Still free. Still relevant. It explains React from the mental model outward instead of starting with syntax. Even developers with experience tend to fill gaps after revisiting it.

https://egghead.io/courses/the-beginner-s-guide-to-react

Josh Comeau's React tutorials
His writing focuses on intuition. Visual explanations help when hooks feel abstract. According to our data, developers who struggle with useEffect often improve after reading his material.

https://www.joshwcomeau.com/tutorials/react/

Hooks and patterns:

Overreacted by Dan Abramov
Some posts are old, but the conceptual pieces on effects, rendering, and mental models remain sharp. The article on useEffect still prevents entire classes of bugs.

https://overreacted.io/

Advanced and structured learning:

Epic React by Kent C. Dodds
This course is expensive. It is also dense. It treats React as a system rather than a library. Exercises force you to think about state isolation, composition, and testing. We think it earns its price if you actually do the work instead of skimming videos.

https://epicreact.dev/

Modern React code example

A simple functional component with TypeScript, hooks, and explicit intent. Nothing fancy. This pattern shows up everywhere in production code.


import { useState, useEffect } from "react";

type User = {
    id: string;
    email: string;
};

export function UserEmail({ userId }: { userId: string }) {
    const [user, setUser] = useState<User | null>(null);
    const [error, setError] = useState<string | null>(null);

    useEffect(() => {
        let active = true;

        async function loadUser() {
            try {
                const response = await fetch(`/api/users/${userId}`);
                if (!response.ok) {
                    throw new Error("Request failed");
                }

                const data: User = await response.json();
                if (active) {
                    setUser(data);
                }
            } catch (err) {
                if (active) {
                    setError("Could not load user");
                }
            }
        }

        loadUser();

        // cleanup prevents state updates on unmounted components
        return () => {
            active = false;
        };
    }, [userId]);

    if (error) {
        return <span>{error}</span>;
    }

    if (!user) {
        return <span>Loading...</span>;
    }

    return <span>{user.email}</span>;
}

This example avoids cleverness. Cleanup logic exists. Types describe intent. Effects depend on explicit inputs. That boring discipline scales.

Closing thoughts

Learning React requires repetition outside client pressure. Training only on the job usually ends with fragile code and frustrated teams. We think contributing to open source projects like PWA Studio helps bridge theory and reality. It exposes you to review, constraints, and tradeoffs you cannot simulate alone.

Before starting a headless project, teams should invest time upfront. Two or three days to align on React basics pays back quickly. You also need someone experienced enough to spot gaps and course correct early. Without that, the architecture might survive, but the codebase probably will not.

sr. Larry Ettinng

sr. Larry Ettinng

Senior Magento Developer