← React Beginner Questions - Set 1 Q1

What is React?

React Beginner Questions - Set 1

The smallest complete React app: one component, mounted into a DOM node. Everything else in React is a variation on this.

Example

import { createRoot } from 'react-dom/client';

function App() {
  return <h1>Hello from React</h1>;
}

const root = createRoot(document.getElementById('root'));
root.render(<App />);

What to notice

← Back to the question list