What is React?

DEFINITION

React is an open-source JavaScript library for building user interfaces from reusable components, widely used for interactive websites, web apps and, through React Native, mobile apps.

React is a JavaScript library, originally created at Facebook and now maintained by Meta and the open-source community, for building user interfaces. You describe the interface as a tree of components, small functions that return what should appear on screen. Components receive data through props and can hold their own state, such as whether a menu is open.

When state changes, React works out what needs updating and changes only those parts of the page. Most React code is written in JSX, a syntax that looks like HTML inside JavaScript.

Why React matters

Reusable components make large interfaces easier to build and maintain: a Button or ProductCard is written once and used everywhere, so design changes happen in one place. React's large ecosystem offers libraries for forms, routing, data fetching and UI kits.

Its popularity also means it is easy to hire developers who know it, and skills transfer to mobile development through React Native.

Example of a React component

A simple counter shows the idea. function Counter() { const [count, setCount] = useState(0); return <button onClick={() => setCount(count + 1)}>Clicked {count} times</button>; } Here useState stores a number, the button displays it, and clicking calls setCount, which makes React re-render the button with the new value. A real product page works the same way at a larger scale, with components for the gallery, price, size selector and add-to-cart button, each managing only its own piece of the interface.

Best practices

  • Keep components small and focused on one job so they are easy to test and reuse.
  • Lift shared state up to the nearest common parent instead of duplicating it.
  • Use a framework such as Next.js for public websites that need SEO and fast first load.
  • Profile performance before adding memoization everywhere.

Common mistakes

  • Building a content website as a client-only React app, leaving crawlers with empty HTML.
  • Storing values in state that could be calculated from existing props or state.
  • Adding large third-party libraries for small features and bloating the JavaScript bundle.

Frequently asked questions

Is React a framework or a library?

React describes itself as a library because it focuses on rendering user interfaces. It does not prescribe routing, data fetching or project structure. Frameworks such as Next.js build on React to provide those pieces, which is why many teams use React through a framework for full websites.

Is React good for SEO?

React itself is neutral. A client-only React app may be harder for search engines to index and slower to show content. Rendering React on the server or at build time, for example with Next.js, sends complete HTML and solves most of these issues while keeping React's interactivity.

What is the difference between React and React Native?

React builds interfaces for web browsers using HTML elements. React Native uses the same component model and JavaScript but renders native mobile interface elements on iOS and Android. Logic and patterns transfer between them, though the visual components and styling approach differ.

Need help with this?

홈페이지 제작 by VYZEON — 빠르게 열리고, 상위에 노출되고, 고객으로 전환되는 홈페이지.

Fixed packages from $299. Written scope, no surprises.

See 홈페이지 제작

Related terms

More Web development terms