What is React?
React is a JavaScript library for building screens out of small functions called components. You do not start with ‘virtual DOM’. You start with: a function returns what the user should see. Change data, React draws again. Facebook open-sourced it. Teams use it for dashboards, shops, admin panels — anywhere the UI keeps changing without a full page reload.
Think of a shop page. Header, product card, cart button. Each piece is a component. The card does not rewrite the whole HTML file when quantity changes. React re-renders that card. That is why people hire React: interactive UI without refreshing the browser like old PHP pages.
It is not a full framework. There is no official router or HTTP client inside the react package. You add React Router, fetch or axios, maybe Redux later. Angular is the contrast: more batteries included. Say that honestly in a viva. ‘React is a UI library’ scores more than a fake feature list.
How does a file actually run? main.jsx (or main.tsx) calls createRoot on <div id="root"> in index.html, then renders <App />. App returns more components. That tree is your whole screen. If #root is missing, nothing appears — a lab trap, not a React bug.
Let’s take this on the board. function Hello({ name }) { return <h1>Hello {name}</h1>; } then <Hello name="Asha" />. Screen: Hello Asha. Change name to Kabir, screen becomes Hello Kabir. No document.getElementById. No innerHTML. Component + data in. That tiny pair is React.
One-way data: parent passes props down. Child does not silently edit the parent. If the child must ask for a change, it calls a callback the parent passed — onSave, onToggle. Freshers try qty++ on a prop. The screen stays stuck. That is the first real bug you will debug.
Learn in this order so you don’t get lost: JSX → function component → props → useState → lists and keys → useEffect → forms. If you jump to Redux on day two you will only copy snippets. If you can explain a click counter and a parent→child name prop out loud, you are actually learning React.
What is React? — on screen — Hello Asha. One function returns UI. Change name → new UI. That is React.
App
│ props
▼
Hello({ name: "Asha" })
│
▼
Hello AshaSay: UI library, component + one prop example. Mention it is not Angular.