React, created by Facebook (Meta) and first released in 2013, lets you describe what a UI should look like for a given state, rather than manually writing the step-by-step DOM operations needed to get there — you write declarative components, and React figures out the most efficient way to update the actual browser DOM to match. It achieves this efficiency through a virtual DOM, an in-memory representation of the UI that React diffs against the previous version after every state change, applying only the minimal set of real DOM updates needed rather than re-rendering the entire page. This component-based, declarative model is what makes React particularly well-suited for building complex, interactive single-page applications that stay maintainable as they grow.
1Understanding What is React?
React, created by Facebook (Meta) and first released in 2013, lets you describe what a UI should look like for a given state, rather than manually writing the step-by-step DOM operations needed to get there — you write declarative components, and React figures out the most efficient way to update the actual browser DOM to match. It achieves this efficiency through a virtual DOM, an in-memory representation of the UI that React diffs against the previous version after every state change, applying only the minimal set of real DOM updates needed rather than re-rendering the entire page. This component-based, declarative model is what makes React particularly well-suited for building complex, interactive single-page applications that stay maintainable as they grow.
React itself only handles the view layer, building and updating the UI — for things like routing or global state management, you'll typically reach for companion libraries like React Router or Redux, rather than expecting React itself to provide them.
import React from 'react';
function Welcome() {
return <h1>Hello, React!</h1>;
}
export default Welcome;2Practical Example
Here is a real-world application of What is React? showing how it is used in production React code.
import React from 'react';
import { createRoot } from 'react-dom/client';
function App() {
return <p>React mounted successfully.</p>;
}
const root = createRoot(document.getElementById('root'));
root.render(<App />);3Best Practices
Follow these guidelines when working with What is React?:
1. Think in terms of components and the state that drives what they render, rather than manually planning DOM manipulation steps
2. Keep components small and focused on one responsibility, composing larger UIs out of smaller, reusable pieces
3. Treat React strictly as the view layer, pairing it with separate libraries for concerns like routing and state management rather than expecting it to do everything
Tip: React itself only handles the view layer, building and updating the UI — for things like routing or global state management, you'll typically reach for companion libraries like React Router or Redux, rather than expecting React itself to provide them.
import React from 'react';
function Welcome() {
return <h1>Hello, React!</h1>;
}
export default Welcome;