Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ReactJS Quiz

Total questions: 15

Worksheet time: 5mins

Name
Class
Date
1.

What is the best definition of React.js?

a)

Server-side Framework

b)

User-interface framework

c)

A Library for building interaction interfaces

d)

None of These

2.

What is the purpose of using JSX in React?

a)

To style components

b)

To make API calls

c)

To describe what the UI should look like

d)

To manage state

3.

In React.js, how we can pass the data from one component to another in React.js?

a)

SetState

b)

Render with arguments

c)

Props

d)

PropTypes

4.

How does data flow naturally in React apps?

a)

From parents to children

b)

From children to parents

c)

Both ways

d)

The developers decides.

5.

Which of the following is true about key props?

a)

"Key" props are used to look beauty

b)

"Key" prop is a way to identify the newly added element

c)

It is one type of attribute of HTML

d)

It is not used in the array

6.

An effect will always run on the initial render.

a)

True

b)

It depends on the dependency array

c)

False

d)

In depends on the code in the effect

7.

What triggers a UI re-render in React?

a)

Running an effect

b)

Passing props

c)

Updating state

d)

Adding event listeners to DOM elements

8.

What's the fundamental building block of React apps?

a)

Components

b)

Blocks

c)

Elements

d)

Effects

9.

What is the most likely preferred port number on which the application runs?

a)

3000

b)

8080

c)

5000

d)

3030

10.

Which of the following is a way to handle data in React.js?

a)

State & Props

b)

Services & Components

c)

State & Services

d)

State & Component

11.

Which variables should go into the useEffect dependency array?

a)

Usually none

b)
  1. Function

c)

All state and props referenced in the effect

d)

All variables needed for clean up

12.

Which of the following is must for the API in React.js?

a)

SetinitialComponent

b)

renderComponent

c)

render

d)

All of the above

13.

Which hook to use for an API request on the component's initial render?

a)

useState

b)

useEffect

c)

useRef

d)

useReducer

14.

Which of the following commands is used to create react-js-app?

a)

npx create-react-app appname

b)

npm install create-react-app

c)

npx install create-react-app -g

d)

install - l create-react-app

15.

Which of the following is NOT a feature of React?

a)

Virtual DOM

b)

Two-way data binding

c)

Component-based architecture

d)

Unidirectional data flow