What is React?
React is a JavaScript library for building user interfaces. It was created by Facebook and is now used by millions of websites. React lets you build complex UIs from small, reusable pieces called components.
Instead of manipulating the DOM directly like vanilla JavaScript, React updates the page efficiently using a virtual DOM. You describe what the UI should look like, and React figures out how to update it.
import React from "react";
import ReactDOM from "react-dom/client";
function App() {
return <h1>Hello, React!</h1>;
}
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<App />);