React (2024)

React (1)

The library for web and native user interfaces

Create user interfaces from components

React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.

Video.js

function Video({ video }) {

return (

<div>

<Thumbnail video={video} />

<a href={video.url}>

<h3>{video.title}</h3>

<p>{video.description}</p>

</a>

<LikeButton video={video} />

</div>

);

}

Whether you work on your own or with thousands of other developers, using React feels the same. It is designed to let you seamlessly combine components written by independent people, teams, and organizations.

Write components with code and markup

React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.

VideoList.js

function VideoList({ videos, emptyHeading }) {

const count = videos.length;

let heading = emptyHeading;

if (count > 0) {

const noun = count > 1 ? 'Videos' : 'Video';

heading = count + ' ' + noun;

}

return (

<section>

<h2>{heading}</h2>

{videos.map(video =>

<Video key={video.id} video={video} />

)}

</section>

);

}

This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. Putting JSX markup close to related rendering logic makes React components easy to create, maintain, and delete.

Add interactivity wherever you need it

React components receive data and return what should appear on the screen. You can pass them new data in response to an interaction, like when the user types into an input. React will then update the screen to match the new data.

SearchableVideoList.js

import { useState } from 'react';

function SearchableVideoList({ videos }) {

const [searchText, setSearchText] = useState('');

const foundVideos = filterVideos(videos, searchText);

return (

<>

<SearchInput

value={searchText}

onChange={newText => setSearchText(newText)} />

<VideoList

videos={foundVideos}

emptyHeading={`No matches for “${searchText}”`} />

</>

);

}

You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it.

Go full-stack
with a framework

React is a library. It lets you put components together, but it doesn’t prescribe how to do routing and data fetching. To build an entire app with React, we recommend a full-stack React framework like Next.js or Remix.

confs/[slug].js

import { db } from './database.js';

import { Suspense } from 'react';

async function ConferencePage({ slug }) {

const conf = await db.Confs.find({ slug });

return (

<ConferenceLayout conf={conf}>

<Suspense fallback={<TalksLoading />}>

<Talks confId={conf.id} />

</Suspense>

</ConferenceLayout>

);

}

async function Talks({ confId }) {

const talks = await db.Talks.findAll({ confId });

const videos = talks.map(talk => talk.video);

return <SearchableVideoList videos={videos} />;

}

example.com/confs/react-conf-2021

React (2)

19 Videos

React is also an architecture. Frameworks that implement it let you fetch data in asynchronous components that run on the server or even during the build. Read data from a file or a database, and pass it down to your interactive components.

Use the best from every platform

People love web and native apps for different reasons. React lets you build both web apps and native apps using the same skills. It leans upon each platform’s unique strengths to let your interfaces feel just right on every platform.

example.com

Stay true to the web

People expect web app pages to load fast. On the server, React lets you start streaming HTML while you’re still fetching data, progressively fillingin the remaining content before any JavaScript code loads. On the client, React can use standard web APIs to keep your UI responsive even in the middle ofrendering.

9:28 PM

Go truly native

People expect native apps to look and feel like their platform. React Native and Expo let you build apps in React for Android, iOS, and more. They look and feel native because their UIs are truly native. It’s not a web view—your React components render real Android and iOS views provided by the platform.

With React, you can be a web and a native developer. Your team can ship to many platforms without sacrificing the user experience. Your organization can bridge the platform silos, and form teams that own entire features end-to-end.

Upgrade when the future is ready

React approaches changes with care. Every React commit is tested on business-critical surfaces with over a billion users. Over 100,000 React components at Meta help validate every migration strategy.

The React team is always researching how to improve React. Some research takes years to pay off. React has a high bar for taking a research idea into production. Only proven approaches become a part of React.

Join a community
of millions

You’re not alone. Two million developers from all over the world visit the React docs every month. React is something that people and teams can agree on.

React (26)

React (27)

React (28)

React (29)

React (30)

React (31)

React (32)

React (33)

React (34)

React (35)

React (36)

React (37)

React (38)

React (39)

React (40)

React (41)

This is why React is more than a library, an architecture, or even an ecosystem. React is a community. It’s a place where you can ask for help, find opportunities, and meet new friends. You will meet both developers and designers, beginners and experts, researchers and artists, teachers and students. Our backgrounds may be very different, but React lets us all create user interfaces together.

React (42)

Welcome to the
React community

Get Started

React (2024)
Top Articles
%kb_name - %short_descr - Knowledge Portal
UPS lost the package I shipped out, was not offered shipping protection, so i can’t get money for it. Can I sue?
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6088

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.