Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →This tutorial takes you from your first React component to the architectural choices that matter in a full application. React builds interfaces from reusable components; you’ll learn how JSX, props, events, and state fit together, then when to use Effects and how to choose a setup for a new or existing project.
What React is—and what it is not
React is a JavaScript library for rendering user interfaces. Its central idea is to describe a screen as a composition of components: small, reusable pieces of UI that can be nested to form a page or application. A component is typically a JavaScript function that returns markup. React’s Describing the UI guide explains this model.
JSX is the HTML-like syntax commonly used to describe that markup inside JavaScript. JSX is optional, and JSX and React are separate concepts, but most React projects use JSX because it makes component output readable. A browser does not execute JSX directly; a project’s build tooling transforms it into JavaScript.
Start React with the right setup
The best starting point depends on what you are building. React can be explored in an online sandbox without installing software, added to an existing site, or used as the UI layer of a new application.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
| Approach | Best fit | Trade-off |
|---|---|---|
| React sandbox | Learning components and trying examples quickly | Useful for experiments, not a substitute for your project’s production setup. |
| Framework | A new full application or site | Provides integrated conventions and solutions for common application needs. |
| Build-tool setup from scratch | Learning fundamentals or a project whose constraints rule out frameworks | You must choose and configure solutions for routing, data fetching, and other common patterns. |
| Add React to an existing website | Gradually making parts of a site interactive | React can coexist with the existing site; adoption need not be an all-at-once rewrite. |
For a new application, React’s current guidance recommends starting with a framework. The documentation lists options including Next.js and React Router. If you start from scratch, you take responsibility for selecting the surrounding tools and patterns. See React’s app-creation guidance and installation options. Create React App is deprecated, so do not use it as the default for a new project.
For development, the official setup guide also covers editor configuration, TypeScript, React Developer Tools, and React Compiler. React Developer Tools is an optional browser extension for inspecting components and their props or state, and for identifying performance problems; it is not required to learn React. See React’s setup guide.
Build your first component
A React component is a function whose name starts with a capital letter. It returns the UI for that part of the screen. Components can be composed by using one component inside another.
function Welcome() {
return <h1>Welcome to React</h1>;
}
function App() {
return (
<main>
<Welcome />
<p>Build the screen from small pieces.</p>
</main>
);
}
In a project, a component may be exported from one file and imported into another. For example, export default function Welcome() { ... } makes the component the file’s default export; another module can import it with import Welcome from './Welcome.js'. The exact filename extension and entry point depend on the project’s setup.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Use JSX to describe the UI
JSX lets you write markup in a JavaScript file. It looks similar to HTML, but it is JavaScript syntax with React-specific conventions. Use one enclosing element for a component’s returned markup, close tags, and use JavaScript expressions inside braces.
function Greeting({ name }) {
return <h1>Hello, {name}!</h1>;
}
In JSX, many attributes use JavaScript-style names—for example, className rather than HTML’s class. Braces let a component insert a variable or expression into its output; they do not accept statements such as a full if block.
Pass data with props
Props are inputs supplied by a parent component. They let a component render different content without duplicating its structure. The Greeting example receives a name prop, which the parent provides like this:
function App() {
return <Greeting name="Mina" />;
}
Components often accept a single props object and use destructuring in the parameter list, as Greeting does. Treat props as values supplied to the component, not as the place for that component to store its changing, private information.
Recommended Free Tools
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Render conditions and lists
Because JSX is written within JavaScript, use ordinary JavaScript expressions to decide what to display. A conditional expression works inside JSX braces:
function Status({ signedIn }) {
return <p>{signedIn ? 'Welcome back' : 'Please sign in'}</p>;
}
Use map to turn an array into repeated components. Give each item a stable key so React can track which item corresponds to which rendered element when the list changes.
const topics = ['Components', 'Props', 'State'];
function TopicList() {
return (
<ul>
{topics.map(topic => <li key={topic}>{topic}</li>)}
</ul>
);
}
For real data, choose a key that uniquely identifies the item among its siblings, such as an ID from the data. Avoid using an array index when list items can be inserted, removed, or reordered.
Handle events and add state
Event handlers make a UI respond to user actions. Pass a function to an event prop such as onClick; do not call the function while rendering. To make the response visible and persist across renders, use state.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
import { useState } from 'react';
function Counter() {
const [count, setCount] = useState(0);
function handleClick() {
setCount(currentCount => currentCount + 1);
}
return (
<button onClick={handleClick}>
Clicked {count} times
</button>
);
}
useState returns the current value and a setter. Calling the setter asks React to render the component again with the new value; it does not mean you should directly change a variable or mutate the existing state. The updater function form, shown above, is helpful when the next value depends on the previous one.
Share state and derive displayed data
State belongs to the component that declares it. When multiple components need to coordinate around the same value, place that state in their nearest shared parent and pass the value and any needed event handlers down through props. This is commonly called lifting state up.
For example, a searchable list can keep the query in its parent, pass it to a search input, and derive the visible items from the full list. The filtered list is calculated from the current query and source data during rendering; it usually does not need separate state.
function VideoSearch({ videos }) {
const [query, setQuery] = useState('');
const visibleVideos = videos.filter(video =>
video.title.toLowerCase().includes(query.toLowerCase())
);
return (
<>
<input
value={query}
onChange={event => setQuery(event.target.value)}
placeholder="Search videos"
/>
<ul>
{visibleVideos.map(video => (
<li key={video.id}>{video.title}</li>
))}
</ul>
</>
);
}
This example brings together state, an event handler, a derived value, and a keyed list. The input’s value is controlled by React state, so typing updates the query and React renders the matching titles.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Use Effects only to synchronize with outside systems
An Effect is for synchronizing a React component with something outside React, such as a browser API, a network connection, or a third-party widget. Effects are not a general-purpose place to put application logic.
Do not use an Effect merely to calculate a value that can be derived during rendering, or to handle an action that belongs directly in an event handler. For example, filter a list during render rather than copying the filtered result into state with an Effect. Put a purchase action in the button’s click handler rather than triggering it because some state changed. This separation keeps the source of each behavior clear.
When an Effect starts a subscription, connection, or other ongoing process, provide cleanup when necessary so it can be stopped when the component no longer needs it. The details depend on the external system. React’s guide to synchronizing with Effects explains when and how to use them.
What changes for advanced React work?
Advanced React is less about collecting hooks and more about making sound decisions about data flow, boundaries, and the application around the components. Apply the same fundamentals at a larger scale:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errors- Choose state ownership deliberately. Keep a value near the components that use it; move it to a shared parent when those components must coordinate.
- Prefer derived values over duplicated state. If a value can be calculated from current props or state, calculate it during rendering unless a specific performance need justifies another approach.
- Keep Effects tied to external synchronization. Separate that work from rendering calculations and user-triggered operations.
- Choose infrastructure for the application’s needs. For a full application, a framework can supply conventions and integrated solutions. A scratch setup means independently choosing routing, data fetching, and other patterns.
- Use development tools to inspect actual behavior. React Developer Tools can help inspect component props and state and investigate performance concerns; it remains an aid, not a prerequisite.
React’s version information listed React 19.3 as the latest version, released September 9, 2026. Because version status changes, check the official React versions page when choosing versions for a project.
Recommended learning sequence
- Review the JavaScript you need for functions, imports and exports, arrays, and callbacks.
- Write a component that returns JSX, then compose it inside another component.
- Pass props to make the same component display different data.
- Render a condition and map an array to a list with stable keys.
- Add an event handler, then use state to make the response persist in the UI.
- Share state through a parent and derive displayed data, as in the searchable-list example.
- Learn Effects after you can identify the external system a component needs to synchronize with.
- Once the mental model is clear, select a framework or integration approach appropriate to the real project.
React’s Quick Start follows a similar progression through components, JSX, data, conditions, lists, events, state, and sharing data.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

