Skip to content

Module quiz: navigation, updating and assets in React.js :React Basics (Meta iOS Developer Professional Certificate) Answers 2026

Question 1

True or false? In React, you can use a ternary operator in a component’s return statement in React.

True
❌ False

Explanation:
React JSX me ternary operators ka use conditional rendering ke liye commonly hota hai.


Question 2

React Router is…

❌ A built-in part of React.
A stand-alone package that you can add to a React app.
❌ A built-in part of React-DOM.

Explanation:
React Router separate npm package hai, React core ka part nahi.


Question 3

React Router has a <Link> element.

True
❌ False

Explanation:
<Link> component React Router me navigation ke liye use hota hai bina page reload ke.


Question 4

Please choose the valid command to install react-player.

npm install react-player
❌ npm-install react-player
❌ npm-install-react-player

Explanation:
npm packages install karne ka correct syntax npm install <package-name> hota hai.


Question 5

True or false? webpack is a module bundler.

True
❌ False

Explanation:
Webpack JavaScript modules, assets, CSS ko bundle karta hai for production.


Question 6

What will be the output of the code below?

let name;
if (Math.random() > 0.5) {
name = "Mike"
} else {
name = "Susan"
}

❌ It will be 0.5
❌ It will always be Mike
It will be sometimes Mike, and sometimes Susan, randomly
❌ It will always be Susan

Explanation:
Math.random() har run me random number deta hai (0–1 ke beech).


Question 7

Is the following component syntactically correct?

import car from "./assets/images/car.jpg";

function CarImage() {
return (
<img
height={200}
src={car}
alt="Car image"
/>
);
}

Yes
❌ No

Explanation:
Asset import + JSX <img /> syntax perfectly valid hai.


Question 8

What is an asset?

Images, stylesheets, fonts
❌ Components
❌ Images, video, and components

Explanation:
Assets wo files hoti hain jo UI ko support karti hain (images, CSS, fonts).


Question 9

What is the syntax used to add a new dev dependency to a React app?
Select all that apply.

❌ npm init some-package-name
npm i –save-dev some-package-name
❌ node init some-package-name
npm install –save-dev some-package-name

Explanation:
--save-dev ya -D flag dev dependencies ke liye hota hai.


Question 10

If your app can compile without it, you can keep an asset in a public folder.

True
❌ False

Explanation:
Public folder ki files build process ka hissa nahi hoti, direct serve hoti hain.


🧾 Summary Table

Q Correct Answer Key Concept
1 True Conditional rendering
2 Stand-alone package React Router
3 True <Link>
4 npm install react-player npm
5 True Webpack
6 Random output Math.random
7 Yes JSX + assets
8 Images, CSS, fonts Assets
9 save-dev commands Dev dependencies
10 True Public folder