curriculum/challenges/english/blocks/quiz-react-basics/66f1a2009e65c9a40a26d51e.md
To pass the quiz, you must correctly answer at least 18 of the 20 questions below.
Which of the following is not a JavaScript library or framework?
Angular
React
JQuery
Laravel
Which of the following is NOT a method for conditional rendering in React?
Ternary operators.
Logical && operator.
if statements.
setTimeout
What is the primary purpose of adding a key prop when rendering a list in React?
To apply a unique CSS style to each list item.
To serve as the text content for the element.
To add an event listener to each specific item in the list.
To help React identify items for efficient rendering.
Where do the project's packages and libraries get installed?
The user directory of your computer.
The package.json file.
The src folder.
The node_modules folder.
Which of the following is TRUE about JSX?
JSX must always be written in separate files from JavaScript.
JSX cannot use JavaScript expressions.
JSX is not recommended for React applications.
JSX allows writing HTML within JavaScript code.
Which of the following is a common problem with SPAs?
Server resources are used more heavily due to constant page rendering.
Browser caching becomes unreliable due to frequent DOM updates.
Multiple page loads create inconsistent state management.
Screen readers struggle with dynamically updated content.
How does a single-page application typically update the view?
By making a full server reload.
By reloading the entire HTML document.
By using server-side rendering only.
By updating only the necessary parts of the page.
Which of the following commands starts a React project in development mode?
npm run build
npm install
npm run develop
npm run dev
Which of the following is not a valid JSX element?
<div className='class'></div>
<span>Hello World</span>
<button>Click Me</button>
``
Which JavaScript array method is commonly used to transform an array of data into an array of JSX elements?
forEach()
filter()
reduce()
map()
Which of the following is the best practice for passing the key prop in React?
Use array indexes in all cases.
Randomly generate keys on each render.
Omit the key prop altogether.
Use unique and stable IDs from the data.
What command installs dependencies listed in package.json?
npm run
npm update
npm build
npm install
How would you pass a name prop to a child component?
<ChildComponent props="name" />
<ChildComponent {props} />
<ChildComponent {'John'} />
<ChildComponent name="Vignesh" />
What is the correct way to pass multiple props using the spread operator in React?
<Child person={name..., age..., city...} />.
<Child spreader={...person} />.
<Child spread={person} />.
<Child {...person} />.
What are the building blocks of React?
Functions and Modules.
DOM Elements and Events.
Classes and Objects.
Reusable Components.
What is the correct way to add an inline style in React?
style={{ color: blue }}
style="color: blue"
style: { color: 'blue' }
style={{ color: 'blue' }}
What is the correct way to conditionally render a React component?
Using if statements inside JSX.
Declaring a new component inside a render() method.
Using while loops inside JSX.
Using ternary operators or logical && operators within JSX.
Which keyword is used to bring a component into another file?
require
include
add
import
What is the full meaning of SPAs?
Server Page Architectures.
Selective Page Applications.
Static Progressive Apps.
Single-page Applications.
Which extension of JavaScript syntax is used to describe the UI in React?
TSC
HTML+
ReactML
JSX