- Home
- /
- Tutorials
- /
- React Tutorial
- /
- What Is React
React Introduction
What Is React
React is a library for describing what should be on screen. You never write the steps to update the page - you describe the result, and React works out the difference.
The one idea
A React app is a tree of components. A component is a function that takes data and returns a description of some UI. When the data changes, React runs the function again and updates only the parts of the page that actually differ.
That is genuinely the whole model. Everything else - props, state, hooks, context - exists to serve it.
A component, rendered
jsx
function Hello() {
return <h2>Hello from a component</h2>
}
const root = ReactDOM.createRoot(document.getElementById("root"))
root.render(<Hello />)