🌍 ReactJS · subject
ReactJS React Basics Syllabus
The React Basics syllabus for ReactJS in full: 3 chapters and 9 topics, every one listed below, plus 51 React Basics flashcards with answers.
React Basics syllabus: all 3 chapters
Expand any chapter to see its topics and sub-topics.
-
Introduction to React
3 topics- What is React?
- History of React
- Why use React?
-
Setting Up the Environment
3 topics- Node.js and npm
- Create React App
- Folder Structure
-
JSX
3 topics- What is JSX?
- JSX Syntax
- Embedding Expressions in JSX
ReactJS React Basics flashcards — 51 questions with answers
What is React?
React is an open-source JavaScript library for building user interfaces, especially single-page applications, using reusable, component-based UI pieces.
Is React a library or a full framework?
React is a library (focused on the view/UI layer), not a full framework; it relies on additional libraries for routing, state management, etc.
Which company created and maintains React?
Meta (Facebook), along with a large open-source community of individual developers.
In which year was React first released publicly?
React was first released publicly in 2013 (open-sourced in May 2013).
Who is credited as the creator of React?
Jordan Walke, a software engineer at Facebook, created React.
What early Facebook prototype did React evolve from?
It evolved from 'FaxJS', and was influenced by Facebook's earlier XHP (an HTML component library for PHP).
On which Facebook product was React first deployed before open-sourcing?
React was first used in Facebook's News Feed (2011) and later on Instagram (2012).
What is the Virtual DOM in React?
The Virtual DOM is a lightweight in-memory JavaScript representation of the real DOM that React uses to compute minimal, efficient updates.
What process does React use to update the real DOM efficiently?
Reconciliation (diffing): React compares the new Virtual DOM with the previous one and applies only the minimal set of changes to the real DOM.
Name three key reasons developers choose to use React.
Reusable component-based architecture, efficient updates via the Virtual DOM, and a large ecosystem/community with strong tooling and reusability.
What programming paradigm does React follow for describing UI?
A declarative paradigm: you describe what the UI should look like for a given state, and React handles updating the DOM.
What is the difference between declarative and imperative UI in the context of React?
Declarative (React): you state the desired end result and React figures out the DOM changes. Imperative (e.g., vanilla JS): you manually write step-by-step DOM manipulation instructions.
What direction does data flow in React by default?
One-way (unidirectional) data flow: data passes from parent to child components via props.
What is a React component?
A component is an independent, reusable piece of UI, typically a JavaScript function (or class) that returns markup describing what should appear on screen.
What are 'props' in React?
Props (properties) are read-only inputs passed from a parent component to a child component to configure or customize it.
What is Node.js?
Node.js is a JavaScript runtime built on Chrome's V8 engine that lets you run JavaScript outside the browser, e.g., on a server or for build tooling.
Why is Node.js needed for React development?
React tooling (bundlers, dev servers, package management) runs on Node.js, and npm ships with Node to install and manage project dependencies.
What does npm stand for?
npm stands for Node Package Manager.
What is npm used for?
npm is the default package manager for Node.js, used to install, share, and manage project dependencies and to run scripts.
Which file records a project's dependencies and scripts in a Node/React project?
package.json records project metadata, dependencies, devDependencies, and npm scripts.
Show the other 31 React Basics flashcards
What is the purpose of package-lock.json?
It locks the exact installed versions of every dependency (and sub-dependency) so installs are reproducible across machines.
Which command installs all dependencies listed in package.json?
npm install (or simply npm i).
What folder does npm install dependencies into?
The node_modules folder in the project root.
What is Create React App (CRA)?
Create React App is an officially supported tool (CLI) that scaffolds a new single-page React project with a preconfigured build setup, requiring no manual configuration.
Which command creates a new project called 'my-app' with Create React App via npx?
npx create-react-app my-app
What does the 'npx' in 'npx create-react-app' do?
npx runs the create-react-app package directly without installing it globally, ensuring you use the latest version.
Which npm script starts the Create React App development server?
npm start
On which default port does the Create React App development server run?
Port 3000 (http://localhost:3000).
Which command produces an optimized production build in Create React App?
npm run build
What build tool does Create React App use under the hood to bundle code (traditionally)?
Webpack (with Babel for transpilation), abstracted away behind react-scripts.
In a Create React App project, what does the 'public' folder contain?
Static assets served as-is, including index.html (the app's single HTML page) and files like favicon.ico and manifest.json.
In a Create React App project, what does the 'src' folder contain?
The application's JavaScript/JSX source code, including index.js (entry point) and App.js (root component).
Which file is the JavaScript entry point in a standard Create React App project?
src/index.js
Which element in public/index.html does React render the app into by default?
The <div> with id="root" (accessed via document.getElementById('root')).
What is the role of App.js in a Create React App project?
App.js defines the root/App component, the top-level component that composes the rest of the UI.
What is JSX?
JSX (JavaScript XML) is a syntax extension for JavaScript that lets you write HTML-like markup directly inside JavaScript code.
Does the browser understand JSX directly?
No. JSX must be transpiled (e.g., by Babel) into regular JavaScript function calls before the browser can run it.
What JavaScript function call does JSX compile to?
JSX compiles to React.createElement(type, props, ...children) calls (or the automatic JSX runtime's equivalent) that produce React elements.
Is JSX required to use React?
No, JSX is optional; you can call React.createElement directly, but JSX is strongly recommended for readability.
In JSX, why is 'className' used instead of 'class'?
Because 'class' is a reserved word in JavaScript, so JSX uses className to set the CSS class attribute.
How are HTML attributes named in JSX?
In camelCase, e.g., onClick, tabIndex, htmlFor (instead of onclick, tabindex, for).
What is the rule about the number of root elements a JSX expression can return?
A JSX expression must return a single root element; multiple siblings must be wrapped in one parent or a React Fragment (<>...</>).
How must self-closing tags be written in JSX?
They must be explicitly closed with a slash, e.g., <img />, <br />, <input />.
What is a React Fragment and why is it used?
A Fragment (<>...</> or <React.Fragment>) groups multiple children without adding an extra DOM node to the output.
How do you embed a JavaScript expression inside JSX?
By wrapping the expression in curly braces, e.g., <h1>{user.name}</h1>.
Can you put statements like if/for directly inside JSX curly braces?
No. Only JavaScript expressions are allowed inside {}; statements are not. Use ternaries, &&, or precompute values outside the JSX.
How would you render the sum of 2 and 3 inside a JSX heading?
Write <h1>{2 + 3}</h1>, which renders 5 because the expression is evaluated in the curly braces.
How do you write a JavaScript comment inside JSX?
Wrap it in curly braces as an expression comment: {/* this is a comment */}.
How do you conditionally render an element in JSX using a boolean expression?
Use short-circuit &&, e.g., {isLoggedIn && <p>Welcome!</p>}, or a ternary {isLoggedIn ? <A/> : <B/>}.
How do you set an inline style on a JSX element?
Pass a JavaScript object to the style attribute with camelCased properties, e.g., style={{ color: 'red', fontSize: '14px' }}.
What do false, null, undefined, and true render to when embedded in JSX?
They render nothing (are ignored), which is why {condition && <Element/>} safely renders nothing when the condition is false.
ReactJS React Basics FAQ
What is in the ReactJS React Basics syllabus?
ReactJS React Basics is split into 3 chapters: Introduction to React, Setting Up the Environment and JSX. Together they contain 9 topics.
How many chapters are in ReactJS React Basics?
3 chapters, containing 9 topics. The largest chapter is Introduction to React, with 3 topics.
Are there flashcards for ReactJS React Basics?
Yes — a 51-card React Basics deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.