History and versions
React has been around long enough to have gone through a few distinct eras, and knowing the rough shape of that history helps you read the code you'll meet in the wild. A tutorial from 2017 and a tutorial from today can both be "React" and yet look quite different. This chapter walks the timeline and explains the two styles you'll run into.
A short timeline
React started at Facebook, where it grew out of the need to keep large, data-heavy interfaces in sync without a tangle of manual DOM updates. It was released as open source in 2013, and the idea at its center, describe the UI for your current data and let React handle the updates, has stayed constant ever since. Almost everything else about how you write React has evolved around that core.
For its first several years, a component that needed to remember something was written as a JavaScript class. Classes are an ordinary JavaScript feature, and React used them to give a component somewhere to keep data that changes over time, along with a set of specially named methods React would call at certain moments: when the component first appeared on screen, when it updated, and when it was removed. This style was the default for a long stretch, and it is why so much of the React code already out there is written that way.
The big shift came with hooks, which arrived in React 16.8 in early 2019. A hook is a function React gives you that lets a plain function component do the things only a class could do before, like remembering a value between renders. Writing a component got a lot shorter, and function components quickly became the default for new code. Hooks covers them properly later on. The one thing to carry forward for now is that hooks are what made the modern style possible.
React has kept moving since: React 18 arrived in 2022 and React 19 in 2024, each adding capabilities and smoothing rough edges. Those releases matter most once you are building real applications, and they come up later in the handbook where they are relevant.
That's the arc in broad strokes. You don't need to memorize dates. The useful takeaway is that React has a long history, the fundamentals have held steady, and the writing style has moved decisively toward function components and hooks.
Two styles of React in the wild
Because of that history, you'll encounter React written in two noticeably different styles.
The older style writes a component as a class. Its changing data lives inside the class, and React calls specially named methods on it at set points in the component's life. A large amount of production code still runs this way, and a great many older tutorials, blog posts, and Stack Overflow answers are written in it. It still works and it is still supported. It is simply the earlier way of writing React.
What the older style looks like
This handbook doesn't teach this style and you don't need to write it. It is worth being able to recognize it, because you will run into it. An older codebase has components that look something like this:
class Counter extends React.Component {
state = { count: 0 }
componentDidMount() {
// React calls this once, just after the component first appears on screen
}
render() {
return <button>Clicked {this.state.count} times</button>
}
}Three things mark it out: class and extends React.Component at the top, this.state as the place its changing data lives, and method names starting with component that React calls automatically at set moments.
The modern style writes a component as a function and uses hooks to give it memory and to run code when things change. This is what new React code is written in, and it's what the official documentation now teaches first.
This track teaches modern React: function components and hooks throughout. Where you're likely to bump into the older class-based equivalent, whether in a codebase at work or an older tutorial, we'll flag it so the two connect in your head and neither one throws you.
From here the handbook builds in the modern style, and Components is where that starts in earnest: a component as a function that returns a piece of your UI. Before any of it runs, though, you need React installed and serving on your own machine.
class with this.state and componentDidMount, don't panic and don't think you're doing it wrong. That's the older style of React, and it still works. This track uses the newer style, function components with hooks, and I'll point out the older equivalents when we pass them so nothing catches you off guard. Next up: Setting up a React project, where you'll get React running on your own machine.

